1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 13:13:53 +00:00

Push yPos to TimelineItem::Preprocess().

This commit is contained in:
Bartosz Taudul 2023-04-05 18:07:09 +02:00
parent 77402eb9c2
commit 9500add83b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
6 changed files with 6 additions and 6 deletions

View File

@ -143,7 +143,7 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
{ {
const auto yPos = wpos.y + yOffset; const auto yPos = wpos.y + yOffset;
const bool visible = m_firstFrame || ( yPos < yMax && yPos + item->GetHeight() >= yMin ); const bool visible = m_firstFrame || ( yPos < yMax && yPos + item->GetHeight() >= yMin );
item->Preprocess( ctx, m_td, visible ); item->Preprocess( ctx, m_td, visible, yPos );
} }
yOffset += m_firstFrame ? 0 : item->GetHeight(); yOffset += m_firstFrame ? 0 : item->GetHeight();
} }

View File

@ -24,7 +24,7 @@ public:
void Draw( bool firstFrame, const TimelineContext& ctx, int yOffset ); void Draw( bool firstFrame, const TimelineContext& ctx, int yOffset );
bool WantPreprocess() const { return m_wantPreprocess; } bool WantPreprocess() const { return m_wantPreprocess; }
virtual void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) { assert( false ); } virtual void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos ) { assert( false ); }
void VisibilityCheckbox(); void VisibilityCheckbox();
virtual void SetVisible( bool visible ) { m_visible = visible; } virtual void SetVisible( bool visible ) { m_visible = visible; }

View File

@ -51,7 +51,7 @@ void TimelineItemCpuData::DrawFinished()
for( auto& v : m_ctxDraw ) v.clear(); for( auto& v : m_ctxDraw ) v.clear();
} }
void TimelineItemCpuData::Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) void TimelineItemCpuData::Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos )
{ {
assert( m_cpuDraw.empty() ); assert( m_cpuDraw.empty() );
for( auto& v : m_ctxDraw ) assert( v.empty() ); for( auto& v : m_ctxDraw ) assert( v.empty() );

View File

@ -30,7 +30,7 @@ protected:
bool IsEmpty() const override; bool IsEmpty() const override;
void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) override; void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos ) override;
private: private:
void PreprocessCpuUsage( const TimelineContext& ctx ); void PreprocessCpuUsage( const TimelineContext& ctx );

View File

@ -281,7 +281,7 @@ void TimelineItemThread::DrawFinished()
m_msgDraw.clear(); m_msgDraw.clear();
} }
void TimelineItemThread::Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) void TimelineItemThread::Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos )
{ {
assert( m_samplesDraw.empty() ); assert( m_samplesDraw.empty() );
assert( m_ctxDraw.empty() ); assert( m_ctxDraw.empty() );

View File

@ -31,7 +31,7 @@ protected:
bool IsEmpty() const override; bool IsEmpty() const override;
void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) override; void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos ) override;
private: private:
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS