Add non-View-dependent thread color getter.

This commit is contained in:
Bartosz Taudul 2022-09-03 19:28:50 +02:00
parent 0c4ca4cd69
commit 6e36469840
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 9 additions and 2 deletions

View File

@ -140,6 +140,12 @@ void TooltipNormalizedName( const char* name, const char* normalized )
}
}
uint32_t GetThreadColor( uint64_t thread, int depth, bool dynamic )
{
if( !dynamic ) return 0xFFCC5555;
return GetHsvColor( thread, depth );
}
uint32_t GetPlotColor( const PlotData& plot, const Worker& worker )
{
switch( plot.type )

View File

@ -25,6 +25,7 @@ void TooltipNormalizedName( const char* name, const char* normalized );
static inline const char* ShortenZoneName( ShortenName type, const char* name ) { ImVec2 tsz = {}; return ShortenZoneName( type, name, tsz, 0 ); }
uint32_t GetThreadColor( uint64_t thread, int depth, bool dynamic );
uint32_t GetPlotColor( const PlotData& plot, const Worker& worker );
const char* FormatPlotValue( double val, PlotValueFormatting format );

View File

@ -2,6 +2,7 @@
#include "TracyColor.hpp"
#include "TracyPrint.hpp"
#include "TracyUtility.hpp"
#include "TracyView.hpp"
namespace tracy
@ -9,8 +10,7 @@ namespace tracy
uint32_t View::GetThreadColor( uint64_t thread, int depth )
{
if( m_vd.dynamicColors == 0 ) return 0xFFCC5555;
return GetHsvColor( thread, depth );
return tracy::GetThreadColor( thread, depth, m_vd.dynamicColors != 0 );
}
uint32_t View::GetRawSrcLocColor( const SourceLocation& srcloc, int depth )