mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 04:43:53 +00:00
Parametrize color highlighting.
This commit is contained in:
parent
3aed0ba150
commit
9d94cdbb52
@ -119,6 +119,15 @@ static tracy_force_inline void PrintStringPercent( char* buf, double percent )
|
|||||||
memcpy( end, "%)", 3 );
|
memcpy( end, "%)", 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<int V = 25>
|
||||||
|
static tracy_force_inline uint32_t HighlightColor( uint32_t color )
|
||||||
|
{
|
||||||
|
return 0xFF000000 |
|
||||||
|
( std::min<int>( 0xFF, ( ( ( color & 0x00FF0000 ) >> 16 ) + V ) ) << 16 ) |
|
||||||
|
( std::min<int>( 0xFF, ( ( ( color & 0x0000FF00 ) >> 8 ) + V ) ) << 8 ) |
|
||||||
|
( std::min<int>( 0xFF, ( ( ( color & 0x000000FF ) ) + V ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
enum { MinVisSize = 3 };
|
enum { MinVisSize = 3 };
|
||||||
enum { MinCtxSize = 4 };
|
enum { MinCtxSize = 4 };
|
||||||
@ -15191,14 +15200,6 @@ uint32_t View::GetRawZoneColor( const GpuEvent& ev )
|
|||||||
return GetZoneColor( ev );
|
return GetZoneColor( ev );
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t View::HighlightColor( uint32_t color )
|
|
||||||
{
|
|
||||||
return 0xFF000000 |
|
|
||||||
( std::min<int>( 0xFF, ( ( ( color & 0x00FF0000 ) >> 16 ) + 25 ) ) << 16 ) |
|
|
||||||
( std::min<int>( 0xFF, ( ( ( color & 0x0000FF00 ) >> 8 ) + 25 ) ) << 8 ) |
|
|
||||||
( std::min<int>( 0xFF, ( ( ( color & 0x000000FF ) ) + 25 ) ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t View::GetZoneHighlight( const ZoneEvent& ev, uint64_t thread, int depth )
|
uint32_t View::GetZoneHighlight( const ZoneEvent& ev, uint64_t thread, int depth )
|
||||||
{
|
{
|
||||||
if( m_zoneInfoWindow == &ev )
|
if( m_zoneInfoWindow == &ev )
|
||||||
|
@ -194,7 +194,6 @@ private:
|
|||||||
uint32_t GetZoneColor( const GpuEvent& ev );
|
uint32_t GetZoneColor( const GpuEvent& ev );
|
||||||
uint32_t GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth );
|
uint32_t GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth );
|
||||||
uint32_t GetRawZoneColor( const GpuEvent& ev );
|
uint32_t GetRawZoneColor( const GpuEvent& ev );
|
||||||
uint32_t HighlightColor( uint32_t color );
|
|
||||||
uint32_t GetZoneHighlight( const ZoneEvent& ev, uint64_t thread, int depth );
|
uint32_t GetZoneHighlight( const ZoneEvent& ev, uint64_t thread, int depth );
|
||||||
uint32_t GetZoneHighlight( const GpuEvent& ev );
|
uint32_t GetZoneHighlight( const GpuEvent& ev );
|
||||||
float GetZoneThickness( const ZoneEvent& ev );
|
float GetZoneThickness( const ZoneEvent& ev );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user