Build messages draw list only if visible.

This commit is contained in:
Bartosz Taudul 2023-04-05 18:55:23 +02:00
parent 4b8ac41345
commit a9ee4c499e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 5 additions and 4 deletions

View File

@ -324,8 +324,8 @@ void TimelineItemThread::Preprocess( const TimelineContext& ctx, TaskDispatch& t
}
m_hasMessages = false;
td.Queue( [this, &ctx, visible] {
PreprocessMessages( ctx, m_thread->messages, m_thread->id, visible );
td.Queue( [this, &ctx, visible, yPos] {
PreprocessMessages( ctx, m_thread->messages, m_thread->id, visible, yPos );
} );
}
@ -572,7 +572,7 @@ void TimelineItemThread::PreprocessSamples( const TimelineContext& ctx, const Ve
}
}
void TimelineItemThread::PreprocessMessages( const TimelineContext& ctx, const Vector<short_ptr<MessageData>>& vec, uint64_t tid, bool visible )
void TimelineItemThread::PreprocessMessages( const TimelineContext& ctx, const Vector<short_ptr<MessageData>>& vec, uint64_t tid, bool visible, int yPos )
{
const auto vStart = ctx.vStart;
const auto vEnd = ctx.vEnd;
@ -587,6 +587,7 @@ void TimelineItemThread::PreprocessMessages( const TimelineContext& ctx, const V
m_hasMessages = true;
if( !visible ) return;
if( yPos > ctx.yMax || yPos + ctx.ty < ctx.yMin ) return;
const auto hMsg = m_view.GetMessageHighlight();
const auto hThread = hMsg ? m_worker.DecompressThread( hMsg->thread ) : 0;

View File

@ -44,7 +44,7 @@ private:
void PreprocessContextSwitches( const TimelineContext& ctx, const ContextSwitch& ctxSwitch, bool visible );
void PreprocessSamples( const TimelineContext& ctx, const Vector<SampleData>& vec, bool visible );
void PreprocessMessages( const TimelineContext& ctx, const Vector<short_ptr<MessageData>>& vec, uint64_t tid, bool visible );
void PreprocessMessages( const TimelineContext& ctx, const Vector<short_ptr<MessageData>>& vec, uint64_t tid, bool visible, int yPos );
const ThreadData* m_thread;
bool m_ghost;