From 119152aac1459f0465568ab0d1e79f2ce49fb72d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 3 Sep 2022 18:34:11 +0200 Subject: [PATCH] Worker must be mutable. This is to allow use of various accessors that cache results, etc. --- server/TracyTimelineController.cpp | 2 +- server/TracyTimelineController.hpp | 4 ++-- server/TracyTimelineItem.cpp | 2 +- server/TracyTimelineItem.hpp | 4 ++-- server/TracyTimelineItemPlot.cpp | 2 +- server/TracyTimelineItemPlot.hpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/TracyTimelineController.cpp b/server/TracyTimelineController.cpp index ae4297cb..6ca8ccb2 100644 --- a/server/TracyTimelineController.cpp +++ b/server/TracyTimelineController.cpp @@ -5,7 +5,7 @@ namespace tracy { -TimelineController::TimelineController( View& view, const Worker& worker ) +TimelineController::TimelineController( View& view, Worker& worker ) : m_height( 0 ) , m_offset( 0 ) , m_scroll( 0 ) diff --git a/server/TracyTimelineController.hpp b/server/TracyTimelineController.hpp index 17090431..8f2c1e37 100644 --- a/server/TracyTimelineController.hpp +++ b/server/TracyTimelineController.hpp @@ -23,7 +23,7 @@ class TimelineController }; public: - TimelineController( View& view, const Worker& worker ); + TimelineController( View& view, Worker& worker ); void FirstFrameExpired(); void Begin(); @@ -73,7 +73,7 @@ private: bool m_firstFrame; View& m_view; - const Worker& m_worker; + Worker& m_worker; }; } diff --git a/server/TracyTimelineItem.cpp b/server/TracyTimelineItem.cpp index 38fd2d41..b7f6ea6a 100644 --- a/server/TracyTimelineItem.cpp +++ b/server/TracyTimelineItem.cpp @@ -8,7 +8,7 @@ namespace tracy { -TimelineItem::TimelineItem( View& view, const Worker& worker ) +TimelineItem::TimelineItem( View& view, Worker& worker ) : m_visible( true ) , m_showFull( true ) , m_height( 0 ) diff --git a/server/TracyTimelineItem.hpp b/server/TracyTimelineItem.hpp index ef9d7a4e..e40358e3 100644 --- a/server/TracyTimelineItem.hpp +++ b/server/TracyTimelineItem.hpp @@ -14,7 +14,7 @@ class Worker; class TimelineItem { public: - TimelineItem( View& view, const Worker& worker ); + TimelineItem( View& view, Worker& worker ); virtual ~TimelineItem() = default; void Draw( bool firstFrame, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax ); @@ -47,7 +47,7 @@ private: protected: View& m_view; - const Worker& m_worker; + Worker& m_worker; }; } diff --git a/server/TracyTimelineItemPlot.cpp b/server/TracyTimelineItemPlot.cpp index 10f96008..83c8920f 100644 --- a/server/TracyTimelineItemPlot.cpp +++ b/server/TracyTimelineItemPlot.cpp @@ -8,7 +8,7 @@ namespace tracy { -TimelineItemPlot::TimelineItemPlot( View& view, const Worker& worker, PlotData* plot ) +TimelineItemPlot::TimelineItemPlot( View& view, Worker& worker, PlotData* plot ) : TimelineItem( view, worker ) , m_plot( plot ) { diff --git a/server/TracyTimelineItemPlot.hpp b/server/TracyTimelineItemPlot.hpp index fa708aff..30ebed22 100644 --- a/server/TracyTimelineItemPlot.hpp +++ b/server/TracyTimelineItemPlot.hpp @@ -10,7 +10,7 @@ namespace tracy class TimelineItemPlot final : public TimelineItem { public: - TimelineItemPlot( View& view, const Worker& worker, PlotData* plot ); + TimelineItemPlot( View& view, Worker& worker, PlotData* plot ); void DrawContents( double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax ) override;