mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-13 03:41:48 +00:00
Store source location color in 24 bits.
This commit is contained in:
parent
ed55fbfacb
commit
ec789d60e8
@ -226,7 +226,9 @@ void Profiler::SendSourceLocation( uint64_t ptr )
|
|||||||
item.srcloc.file = (uint64_t)srcloc->file;
|
item.srcloc.file = (uint64_t)srcloc->file;
|
||||||
item.srcloc.function = (uint64_t)srcloc->function;
|
item.srcloc.function = (uint64_t)srcloc->function;
|
||||||
item.srcloc.line = srcloc->line;
|
item.srcloc.line = srcloc->line;
|
||||||
item.srcloc.color = srcloc->color;
|
item.srcloc.r = ( srcloc->color ) & 0xFF;
|
||||||
|
item.srcloc.g = ( srcloc->color >> 8 ) & 0xFF;
|
||||||
|
item.srcloc.b = ( srcloc->color >> 16 ) & 0xFF;
|
||||||
s_token.ptr->enqueue<moodycamel::CanAlloc>( std::move( item ) );
|
s_token.ptr->enqueue<moodycamel::CanAlloc>( std::move( item ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,9 @@ struct QueueSourceLocation
|
|||||||
uint64_t function; // ptr
|
uint64_t function; // ptr
|
||||||
uint64_t file; // ptr
|
uint64_t file; // ptr
|
||||||
uint32_t line;
|
uint32_t line;
|
||||||
uint32_t color;
|
uint8_t r;
|
||||||
|
uint8_t g;
|
||||||
|
uint8_t b;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QueueZoneText
|
struct QueueZoneText
|
||||||
|
@ -1666,7 +1666,7 @@ int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, con
|
|||||||
++it;
|
++it;
|
||||||
if( it == zitend ) break;
|
if( it == zitend ) break;
|
||||||
auto& srcloc2 = GetSourceLocation( (*it)->srcloc );
|
auto& srcloc2 = GetSourceLocation( (*it)->srcloc );
|
||||||
if( srcloc.color != srcloc2.color ) break;
|
if( srcloc.r != srcloc2.r || srcloc.g != srcloc2.g || srcloc.b != srcloc2.b ) break;
|
||||||
const auto nend = GetZoneEnd( **it );
|
const auto nend = GetZoneEnd( **it );
|
||||||
const auto pxnext = ( nend - m_zvStart ) * pxns;
|
const auto pxnext = ( nend - m_zvStart ) * pxns;
|
||||||
if( pxnext - px1 >= MinVisSize * 2 ) break;
|
if( pxnext - px1 >= MinVisSize * 2 ) break;
|
||||||
@ -2390,7 +2390,8 @@ uint32_t View::GetZoneColor( const Event& ev )
|
|||||||
|
|
||||||
uint32_t View::GetZoneColor( const QueueSourceLocation& srcloc )
|
uint32_t View::GetZoneColor( const QueueSourceLocation& srcloc )
|
||||||
{
|
{
|
||||||
return srcloc.color != 0 ? ( srcloc.color | 0xFF000000 ) : 0xFFCC5555;
|
const auto color = srcloc.r | ( srcloc.g << 8 ) | ( srcloc.b << 16 );
|
||||||
|
return color != 0 ? ( color | 0xFF000000 ) : 0xFFCC5555;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t View::GetZoneHighlight( const Event& ev, bool migration )
|
uint32_t View::GetZoneHighlight( const Event& ev, bool migration )
|
||||||
|
Loading…
Reference in New Issue
Block a user