From 8ddf32bc6b35380f43a3e032382127a73ce3205b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Jul 2018 19:53:11 +0200 Subject: [PATCH] Highlight zones with the same srcloc on hover. --- server/TracyView.cpp | 22 ++++++++++++++++++++++ server/TracyView.hpp | 2 ++ 2 files changed, 24 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 071c0651..f5f1c86f 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -216,6 +216,8 @@ View::View( const char* addr ) , m_zvHeight( 0 ) , m_zvScroll( 0 ) , m_zoneInfoWindow( nullptr ) + , m_zoneSrcLocHighlight( 0 ) + , m_zoneSrcLocHighlightActive( false ) , m_lockHighlight { -1 } , m_gpuInfoWindow( nullptr ) , m_callstackInfoWindow( 0 ) @@ -255,6 +257,8 @@ View::View( FileRead& f ) , m_zvHeight( 0 ) , m_zvScroll( 0 ) , m_zoneInfoWindow( nullptr ) + , m_zoneSrcLocHighlight( 0 ) + , m_zoneSrcLocHighlightActive( false ) , m_gpuInfoWindow( nullptr ) , m_callstackInfoWindow( 0 ) , m_memoryAllocInfoWindow( -1 ) @@ -967,6 +971,14 @@ bool View::DrawZoneFrames() void View::DrawZones() { m_msgHighlight = nullptr; + if( m_zoneSrcLocHighlightActive ) + { + m_zoneSrcLocHighlightActive = false; + } + else + { + m_zoneSrcLocHighlight = 0; + } if( m_zvStart == m_zvEnd ) return; assert( m_zvStart < m_zvEnd ); @@ -1354,6 +1366,9 @@ int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, { ShowZoneInfo( ev ); } + + m_zoneSrcLocHighlight = ev.srcloc; + m_zoneSrcLocHighlightActive = true; } } char tmp[64]; @@ -1457,6 +1472,9 @@ int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, { ShowZoneInfo( ev ); } + + m_zoneSrcLocHighlight = ev.srcloc; + m_zoneSrcLocHighlightActive = true; } ++it; @@ -5944,6 +5962,10 @@ uint32_t View::GetZoneHighlight( const ZoneEvent& ev, bool migration ) { return 0xFF4444FF; } + else if( m_zoneSrcLocHighlight == ev.srcloc ) + { + return 0xFFEEEEEE; + } else if( migration ) { return 0xFFDD22DD; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 2285a640..a2c76f92 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -183,6 +183,8 @@ private: const ZoneEvent* m_zoneInfoWindow; const ZoneEvent* m_zoneHighlight; + uint64_t m_zoneSrcLocHighlight; + bool m_zoneSrcLocHighlightActive; LockHighlight m_lockHighlight; const MessageData* m_msgHighlight; const GpuEvent* m_gpuInfoWindow;