mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Add function to get zone color.
This commit is contained in:
parent
3dc4fc4796
commit
7365461ef4
@ -1253,7 +1253,7 @@ int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, con
|
||||
{
|
||||
auto& ev = **it;
|
||||
auto& srcloc = GetSourceLocation( ev.srcloc );
|
||||
const auto color = srcloc.color != 0 ? ( srcloc.color | 0xFF000000 ) : 0xDDDD6666;
|
||||
const auto color = GetZoneColor( srcloc );
|
||||
const auto end = GetZoneEnd( ev );
|
||||
const auto zsz = ( end - ev.start ) * pxns;
|
||||
if( zsz < MinVisSize )
|
||||
@ -1498,6 +1498,16 @@ void View::DrawZoneInfoWindow()
|
||||
if( !show ) m_zoneInfoWindow = nullptr;
|
||||
}
|
||||
|
||||
uint32_t View::GetZoneColor( const Event& ev )
|
||||
{
|
||||
return GetZoneColor( GetSourceLocation( ev.srcloc ) );
|
||||
}
|
||||
|
||||
uint32_t View::GetZoneColor( const QueueSourceLocation& srcloc )
|
||||
{
|
||||
return srcloc.color != 0 ? ( srcloc.color | 0xFF000000 ) : 0xDDDD6666;
|
||||
}
|
||||
|
||||
uint32_t View::GetZoneHighlight( const Event& ev )
|
||||
{
|
||||
if( m_zoneInfoWindow == &ev )
|
||||
@ -1510,7 +1520,7 @@ uint32_t View::GetZoneHighlight( const Event& ev )
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0xAAAAAAAA;
|
||||
return 0xFF888888;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,11 @@ private:
|
||||
int DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth );
|
||||
void DrawZoneInfoWindow();
|
||||
|
||||
uint32_t GetZoneColor( const Event& ev );
|
||||
uint32_t GetZoneColor( const QueueSourceLocation& srcloc );
|
||||
uint32_t GetZoneHighlight( const Event& ev );
|
||||
float GetZoneThickness( const Event& ev );
|
||||
|
||||
void ZoomToZone( const Event& ev );
|
||||
void ZoneTooltip( const Event& ev );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user