mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Push item visibility to Preprocess().
This commit is contained in:
parent
8c1b519fa1
commit
7ec68f8b52
@ -133,17 +133,20 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
|
|||||||
ctx.wpos = wpos;
|
ctx.wpos = wpos;
|
||||||
ctx.hover = hover;
|
ctx.hover = hover;
|
||||||
|
|
||||||
|
int yOffset = 0;
|
||||||
for( auto& item : m_items )
|
for( auto& item : m_items )
|
||||||
{
|
{
|
||||||
if( item->WantPreprocess() && item->IsVisible() )
|
if( item->WantPreprocess() && item->IsVisible() )
|
||||||
{
|
{
|
||||||
item->Preprocess( ctx, m_td );
|
const auto yPos = wpos.y + yOffset;
|
||||||
|
const bool visible = m_firstFrame || ( yPos < yMax && yPos + item->GetNextFrameHeight() >= yMin );
|
||||||
|
item->Preprocess( ctx, m_td, visible );
|
||||||
}
|
}
|
||||||
|
yOffset += m_firstFrame ? 0 : item->GetNextFrameHeight();
|
||||||
}
|
}
|
||||||
m_td.Sync();
|
m_td.Sync();
|
||||||
|
|
||||||
int yOffset = 0;
|
yOffset = 0;
|
||||||
|
|
||||||
for( auto& item : m_items )
|
for( auto& item : m_items )
|
||||||
{
|
{
|
||||||
auto currentFrameItemHeight = item->GetNextFrameHeight();
|
auto currentFrameItemHeight = item->GetNextFrameHeight();
|
||||||
|
@ -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 ) { assert( false ); }
|
virtual void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) { assert( false ); }
|
||||||
|
|
||||||
void VisibilityCheckbox();
|
void VisibilityCheckbox();
|
||||||
virtual void SetVisible( bool visible ) { m_visible = visible; }
|
virtual void SetVisible( bool visible ) { m_visible = visible; }
|
||||||
|
@ -281,7 +281,7 @@ void TimelineItemThread::DrawFinished()
|
|||||||
m_msgDraw.clear();
|
m_msgDraw.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimelineItemThread::Preprocess( const TimelineContext& ctx, TaskDispatch& td )
|
void TimelineItemThread::Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible )
|
||||||
{
|
{
|
||||||
assert( m_samplesDraw.empty() );
|
assert( m_samplesDraw.empty() );
|
||||||
assert( m_ctxDraw.empty() );
|
assert( m_ctxDraw.empty() );
|
||||||
|
@ -31,7 +31,7 @@ protected:
|
|||||||
|
|
||||||
bool IsEmpty() const override;
|
bool IsEmpty() const override;
|
||||||
|
|
||||||
void Preprocess( const TimelineContext& ctx, TaskDispatch& td ) override;
|
void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef TRACY_NO_STATISTICS
|
#ifndef TRACY_NO_STATISTICS
|
||||||
|
Loading…
Reference in New Issue
Block a user