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

Make srcloc dynamic color depend on function name.

This commit is contained in:
Bartosz Taudul
2019-11-01 20:17:25 +01:00
parent ca0fae33d1
commit 13b656fe61
3 changed files with 29 additions and 7 deletions
+16 -1
View File
@@ -12849,7 +12849,22 @@ uint32_t View::GetRawZoneColor( const ZoneEvent& ev, uint64_t thread, int depth
if( color != 0 ) return color | 0xFF000000;
if( m_vd.dynamicColors == 2 )
{
return GetThreadColor( sl, depth );
auto namehash = srcloc.namehash;
if( namehash == 0 && srcloc.function.active )
{
const auto f = m_worker.GetString( srcloc.function );
namehash = charutil::hash( f );
if( namehash == 0 ) namehash++;
srcloc.namehash = namehash;
}
if( namehash == 0 )
{
return GetThreadColor( sl, depth );
}
else
{
return GetThreadColor( namehash, depth );
}
}
else
{