mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08: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& ev = **it;
|
||||||
auto& srcloc = GetSourceLocation( ev.srcloc );
|
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 end = GetZoneEnd( ev );
|
||||||
const auto zsz = ( end - ev.start ) * pxns;
|
const auto zsz = ( end - ev.start ) * pxns;
|
||||||
if( zsz < MinVisSize )
|
if( zsz < MinVisSize )
|
||||||
@ -1498,6 +1498,16 @@ void View::DrawZoneInfoWindow()
|
|||||||
if( !show ) m_zoneInfoWindow = nullptr;
|
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 )
|
uint32_t View::GetZoneHighlight( const Event& ev )
|
||||||
{
|
{
|
||||||
if( m_zoneInfoWindow == &ev )
|
if( m_zoneInfoWindow == &ev )
|
||||||
@ -1510,7 +1520,7 @@ uint32_t View::GetZoneHighlight( const Event& ev )
|
|||||||
}
|
}
|
||||||
else
|
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 );
|
int DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth );
|
||||||
void DrawZoneInfoWindow();
|
void DrawZoneInfoWindow();
|
||||||
|
|
||||||
|
uint32_t GetZoneColor( const Event& ev );
|
||||||
|
uint32_t GetZoneColor( const QueueSourceLocation& srcloc );
|
||||||
uint32_t GetZoneHighlight( const Event& ev );
|
uint32_t GetZoneHighlight( const Event& ev );
|
||||||
float GetZoneThickness( const Event& ev );
|
float GetZoneThickness( const Event& ev );
|
||||||
|
|
||||||
void ZoomToZone( const Event& ev );
|
void ZoomToZone( const Event& ev );
|
||||||
void ZoneTooltip( const Event& ev );
|
void ZoneTooltip( const Event& ev );
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user