mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Extract thread color getter.
This commit is contained in:
parent
9cd359f0b9
commit
00409b0b94
@ -11849,13 +11849,8 @@ uint32_t View::GetZoneColor( const ZoneEvent& ev, uint64_t thread, int depth )
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t View::GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth )
|
||||
uint32_t View::GetThreadColor( uint64_t thread, int depth )
|
||||
{
|
||||
const auto& srcloc = m_worker.GetSourceLocation( ev.SrcLoc() );
|
||||
const auto color = srcloc.color;
|
||||
if( color != 0 ) return color | 0xFF000000;
|
||||
if( !m_vd.dynamicColors ) return 0xFFCC5555;
|
||||
|
||||
const uint8_t h = thread & 0xFF;
|
||||
const uint8_t s = 96;
|
||||
const uint8_t v = std::max( 96, 170 - depth * 8 );
|
||||
@ -11882,6 +11877,15 @@ uint32_t View::GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth
|
||||
return 0xFF000000 | ( r << 16 ) | ( g << 8 ) | b;
|
||||
}
|
||||
|
||||
uint32_t View::GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth )
|
||||
{
|
||||
const auto& srcloc = m_worker.GetSourceLocation( ev.SrcLoc() );
|
||||
const auto color = srcloc.color;
|
||||
if( color != 0 ) return color | 0xFF000000;
|
||||
if( !m_vd.dynamicColors ) return 0xFFCC5555;
|
||||
return GetThreadColor( thread, depth );
|
||||
}
|
||||
|
||||
uint32_t View::GetZoneColor( const GpuEvent& ev )
|
||||
{
|
||||
const auto& srcloc = m_worker.GetSourceLocation( ev.srcloc );
|
||||
|
@ -154,6 +154,7 @@ private:
|
||||
|
||||
void HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, double& pxns );
|
||||
|
||||
uint32_t GetThreadColor( uint64_t thread, int depth );
|
||||
uint32_t GetZoneColor( const ZoneEvent& ev, uint64_t thread, int depth );
|
||||
uint32_t GetZoneColor( const GpuEvent& ev );
|
||||
uint32_t GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth );
|
||||
|
Loading…
x
Reference in New Issue
Block a user