1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Allow adding custom colors to zones.

This commit is contained in:
Bartosz Taudul
2017-09-25 22:46:14 +02:00
parent 93fc85a639
commit 519cb8dff3
6 changed files with 17 additions and 9 deletions
+4 -4
View File
@@ -288,7 +288,7 @@ void Profiler::CalibrateTimer()
class FakeZone
{
public:
FakeZone( const char* file, const char* function, uint32_t line ) {}
FakeZone( const char* file, const char* function, uint32_t line, uint32_t color ) {}
~FakeZone() {}
private:
@@ -302,17 +302,17 @@ void Profiler::CalibrateDelay()
static_assert( Events * 2 < QueuePrealloc, "Delay calibration loop will allocate memory in queue" );
for( int i=0; i<Iterations; i++ )
{
ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__ );
ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__, 0 );
}
const auto f0 = GetTime();
for( int i=0; i<Iterations; i++ )
{
FakeZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__ );
FakeZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__, 0 );
}
const auto t0 = GetTime();
for( int i=0; i<Iterations; i++ )
{
ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__ );
ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__, 0 );
}
const auto t1 = GetTime();
const auto dt = t1 - t0;