Push locks draw lists to DrawThread().

This commit is contained in:
Bartosz Taudul 2023-04-15 12:51:10 +02:00
parent 7f301dfec0
commit f7a8998663
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 4 additions and 3 deletions

View File

@ -260,7 +260,7 @@ void TimelineItemThread::HeaderExtraContents( const TimelineContext& ctx, int of
bool TimelineItemThread::DrawContents( const TimelineContext& ctx, int& offset )
{
m_view.DrawThread( ctx, *m_thread, m_draw, m_ctxDraw, m_samplesDraw, offset, m_depth, m_hasCtxSwitch, m_hasSamples );
m_view.DrawThread( ctx, *m_thread, m_draw, m_ctxDraw, m_samplesDraw, m_lockDraw, offset, m_depth, m_hasCtxSwitch, m_hasSamples );
if( m_depth == 0 && !m_hasMessages )
{
auto& crash = m_worker.GetCrashEvent();

View File

@ -47,6 +47,7 @@ struct SamplesDraw;
struct MessagesDraw;
struct CpuUsageDraw;
struct CpuCtxDraw;
struct LockDraw;
class View
{
@ -137,7 +138,7 @@ public:
void HighlightThread( uint64_t thread );
void ZoomToRange( int64_t start, int64_t end, bool pause = true );
bool DrawPlot( const TimelineContext& ctx, PlotData& plot, int& offset );
void DrawThread( const TimelineContext& ctx, const ThreadData& thread, const std::vector<TimelineDraw>& draw, const std::vector<ContextSwitchDraw>& ctxDraw, const std::vector<SamplesDraw>& samplesDraw, int& offset, int depth, bool hasCtxSwitches, bool hasSamples );
void DrawThread( const TimelineContext& ctx, const ThreadData& thread, const std::vector<TimelineDraw>& draw, const std::vector<ContextSwitchDraw>& ctxDraw, const std::vector<SamplesDraw>& samplesDraw, const std::vector<std::unique_ptr<LockDraw>>& lockDraw, int& offset, int depth, bool hasCtxSwitches, bool hasSamples );
void DrawThreadMessagesList( const TimelineContext& ctx, const std::vector<MessagesDraw>& drawList, int offset, uint64_t tid );
void DrawThreadOverlays( const ThreadData& thread, const ImVec2& ul, const ImVec2& dr );
bool DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset );

View File

@ -23,7 +23,7 @@ static tracy_force_inline uint32_t MixGhostColor( uint32_t c0, uint32_t c1 )
( ( ( ( ( c0 & 0x000000FF ) ) + 3 * ( ( c1 & 0x000000FF ) ) ) >> 2 ) );
}
void View::DrawThread( const TimelineContext& ctx, const ThreadData& thread, const std::vector<TimelineDraw>& draw, const std::vector<ContextSwitchDraw>& ctxDraw, const std::vector<SamplesDraw>& samplesDraw, int& offset, int depth, bool _hasCtxSwitches, bool _hasSamples )
void View::DrawThread( const TimelineContext& ctx, const ThreadData& thread, const std::vector<TimelineDraw>& draw, const std::vector<ContextSwitchDraw>& ctxDraw, const std::vector<SamplesDraw>& samplesDraw, const std::vector<std::unique_ptr<LockDraw>>& lockDraw, int& offset, int depth, bool _hasCtxSwitches, bool _hasSamples )
{
const auto& wpos = ctx.wpos;
const auto ty = ctx.ty;