mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Support source location dynamic colors for ghost zones.
This commit is contained in:
parent
9cbb57b193
commit
2ac7048248
@ -3949,9 +3949,6 @@ int View::DrawGhostLevel( const Vector<GhostZone>& vec, bool hover, double pxns,
|
|||||||
const auto offset = _offset + ostep * depth;
|
const auto offset = _offset + ostep * depth;
|
||||||
auto draw = ImGui::GetWindowDrawList();
|
auto draw = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
const auto color = MixGhostColor( GetThreadColor( tid, depth ), 0x665555 );
|
|
||||||
const auto outline = HighlightColor( color );
|
|
||||||
|
|
||||||
depth++;
|
depth++;
|
||||||
int maxdepth = depth;
|
int maxdepth = depth;
|
||||||
|
|
||||||
@ -3962,6 +3959,7 @@ int View::DrawGhostLevel( const Vector<GhostZone>& vec, bool hover, double pxns,
|
|||||||
const auto zsz = std::max( ( end - ev.start.Val() ) * pxns, pxns * 0.5 );
|
const auto zsz = std::max( ( end - ev.start.Val() ) * pxns, pxns * 0.5 );
|
||||||
if( zsz < MinVisSize )
|
if( zsz < MinVisSize )
|
||||||
{
|
{
|
||||||
|
const auto color = MixGhostColor( GetThreadColor( tid, depth ), 0x665555 );
|
||||||
const auto px0 = ( ev.start.Val() - m_vd.zvStart ) * pxns;
|
const auto px0 = ( ev.start.Val() - m_vd.zvStart ) * pxns;
|
||||||
auto px1 = ( ev.end.Val() - m_vd.zvStart ) * pxns;
|
auto px1 = ( ev.end.Val() - m_vd.zvStart ) * pxns;
|
||||||
auto rend = end;
|
auto rend = end;
|
||||||
@ -4000,6 +3998,26 @@ int View::DrawGhostLevel( const Vector<GhostZone>& vec, bool hover, double pxns,
|
|||||||
{
|
{
|
||||||
const auto& ghostKey = m_worker.GetGhostFrame( ev.frame );
|
const auto& ghostKey = m_worker.GetGhostFrame( ev.frame );
|
||||||
const auto frame = m_worker.GetCallstackFrame( ghostKey.frame );
|
const auto frame = m_worker.GetCallstackFrame( ghostKey.frame );
|
||||||
|
|
||||||
|
uint32_t color;
|
||||||
|
if( m_vd.dynamicColors == 2 )
|
||||||
|
{
|
||||||
|
if( frame )
|
||||||
|
{
|
||||||
|
const auto& sym = frame->data[ghostKey.inlineFrame];
|
||||||
|
color = GetHsvColor( sym.name.Idx(), depth );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color = GetHsvColor( ghostKey.frame.data, depth );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color = MixGhostColor( GetThreadColor( tid, depth ), 0x665555 );
|
||||||
|
}
|
||||||
|
const auto outline = HighlightColor( color );
|
||||||
|
|
||||||
const auto pr0 = ( ev.start.Val() - m_vd.zvStart ) * pxns;
|
const auto pr0 = ( ev.start.Val() - m_vd.zvStart ) * pxns;
|
||||||
const auto pr1 = ( ev.end.Val() - m_vd.zvStart ) * pxns;
|
const auto pr1 = ( ev.end.Val() - m_vd.zvStart ) * pxns;
|
||||||
const auto px0 = std::max( pr0, -10.0 );
|
const auto px0 = std::max( pr0, -10.0 );
|
||||||
|
Loading…
Reference in New Issue
Block a user