From 8eb2cc83b3faf37a617d8746cdb79fe255e9f84c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 18 Apr 2023 20:30:54 +0200 Subject: [PATCH] Push plot draw list to DrawPlot(). --- server/TracyTimelineItemPlot.cpp | 2 +- server/TracyTimelineItemPlot.hpp | 2 +- server/TracyView.hpp | 4 +++- server/TracyView_Plots.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/TracyTimelineItemPlot.cpp b/server/TracyTimelineItemPlot.cpp index d6195d4e..8f419ded 100644 --- a/server/TracyTimelineItemPlot.cpp +++ b/server/TracyTimelineItemPlot.cpp @@ -111,7 +111,7 @@ int64_t TimelineItemPlot::RangeEnd() const bool TimelineItemPlot::DrawContents( const TimelineContext& ctx, int& offset ) { - return m_view.DrawPlot( ctx, *m_plot, offset ); + return m_view.DrawPlot( ctx, *m_plot, m_draw, offset ); } void TimelineItemPlot::DrawFinished() diff --git a/server/TracyTimelineItemPlot.hpp b/server/TracyTimelineItemPlot.hpp index c59ac2af..ec2fdf0e 100644 --- a/server/TracyTimelineItemPlot.hpp +++ b/server/TracyTimelineItemPlot.hpp @@ -35,7 +35,7 @@ protected: private: PlotData* m_plot; - std::vector m_draw; + std::vector m_draw; }; } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index b8ed6e3f..7534240f 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -48,6 +48,8 @@ struct MessagesDraw; struct CpuUsageDraw; struct CpuCtxDraw; struct LockDraw; +struct PlotDraw; + class View { @@ -137,7 +139,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 ); + bool DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vector& plotDraw, int& offset ); void DrawThread( const TimelineContext& ctx, const ThreadData& thread, const std::vector& draw, const std::vector& ctxDraw, const std::vector& samplesDraw, const std::vector>& lockDraw, int& offset, int depth, bool hasCtxSwitches, bool hasSamples ); void DrawThreadMessagesList( const TimelineContext& ctx, const std::vector& drawList, int offset, uint64_t tid ); void DrawThreadOverlays( const ThreadData& thread, const ImVec2& ul, const ImVec2& dr ); diff --git a/server/TracyView_Plots.cpp b/server/TracyView_Plots.cpp index 8fa93ef2..2ebbdccd 100644 --- a/server/TracyView_Plots.cpp +++ b/server/TracyView_Plots.cpp @@ -11,7 +11,7 @@ namespace tracy { -bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, int& offset ) +bool View::DrawPlot( const TimelineContext& ctx, PlotData& plot, const std::vector& plotDraw, int& offset ) { auto& vec = plot.data; vec.ensure_sorted();