Highlight zones with the same srcloc on hover.

This commit is contained in:
Bartosz Taudul 2018-07-28 19:53:11 +02:00
parent c124e49443
commit 8ddf32bc6b
2 changed files with 24 additions and 0 deletions

View File

@ -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<ZoneEvent*>& 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<ZoneEvent*>& 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;

View File

@ -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;