diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-08-20 18:02:29 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-08-20 18:02:29 +0300 |
commit | 655d8a01ea9cc08b014bd1f38e3db2bc87be90e6 (patch) | |
tree | 2ce67c718b76b8ea7e41ecd6551cc171a8106ed1 /server/TracyTimelineController.hpp | |
parent | 49bda91be56581dd2d33ff1829deec4f07b7d0f1 (diff) |
Move vis data to timeline controller.
Diffstat (limited to 'server/TracyTimelineController.hpp')
-rw-r--r-- | server/TracyTimelineController.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/server/TracyTimelineController.hpp b/server/TracyTimelineController.hpp index 20c51390..eccb8edd 100644 --- a/server/TracyTimelineController.hpp +++ b/server/TracyTimelineController.hpp @@ -1,22 +1,53 @@ #ifndef __TRACYTIMELINECONTROLLER_HPP__ #define __TRACYTIMELINECONTROLLER_HPP__ +#include "../public/common/TracyForceInline.hpp" +#include "tracy_robin_hood.h" + namespace tracy { class TimelineController { + struct VisData + { + bool visible = true; + bool showFull = true; + bool ghost = false; + int offset = 0; + int height = 0; + }; + public: TimelineController(); + void FirstFrameExpired(); void End( float offset ); float GetHeight() const { return m_height; } + const unordered_flat_map<const void*, VisData>& GetVisData() const { return m_visData; } + + void AdjustThreadHeight( VisData& vis, int oldOffset, int& offset ); + float AdjustThreadPosition( VisData& vis, float wy, int& offset ); + + tracy_force_inline VisData& Vis( const void* ptr ) + { + auto it = m_visData.find( ptr ); + if( it == m_visData.end() ) + { + it = m_visData.emplace( ptr, VisData {} ).first; + } + return it->second; + } private: + unordered_flat_map<const void*, VisData> m_visData; + float m_height; float m_offset; float m_scroll; + + bool m_firstFrame; }; } |