mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Add per-thread ghost zones switch.
This commit is contained in:
parent
6daa429b69
commit
77d30adee9
@ -2713,7 +2713,37 @@ void View::DrawZones()
|
||||
}
|
||||
DrawTextContrast( draw, wpos + ImVec2( ty, oldOffset ), labelColor, txt );
|
||||
|
||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, oldOffset ), wpos + ImVec2( ty + txtsz.x, oldOffset + ty ) ) )
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
const bool hasGhostZones = showFull && m_worker.AreGhostZonesReady() && !v->ghostZones.empty();
|
||||
float ghostSz;
|
||||
if( hasGhostZones )
|
||||
{
|
||||
auto& vis = Vis( v );
|
||||
const auto color = vis.ghost ? 0xFFAA9999 : 0x88AA7777;
|
||||
#ifdef TRACY_EXTENDED_FONT
|
||||
draw->AddText( wpos + ImVec2( 1.5f * ty + txtsz.x, oldOffset ), color, ICON_FA_GHOST );
|
||||
ghostSz = ImGui::CalcTextSize( ICON_FA_GHOST ).x;
|
||||
#else
|
||||
draw->AddText( draw, wpos + ImVec2( 1.5f * ty + txtsz.x, oldOffset ), color, "ghost" );
|
||||
ghostSz = ImGui::CalcTextSize( "ghost" ).x;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if( hover )
|
||||
{
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
if( hasGhostZones && ImGui::IsMouseHoveringRect( wpos + ImVec2( 1.5f * ty + txtsz.x, oldOffset ), wpos + ImVec2( 1.5f * ty + txtsz.x + ghostSz, oldOffset + ty ) ) )
|
||||
{
|
||||
if( ImGui::IsMouseClicked( 0 ) )
|
||||
{
|
||||
auto& vis = Vis( v );
|
||||
vis.ghost = !vis.ghost;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if( ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, oldOffset ), wpos + ImVec2( ty + txtsz.x, oldOffset + ty ) ) )
|
||||
{
|
||||
m_drawThreadMigrations = v->id;
|
||||
m_drawThreadHighlight = v->id;
|
||||
@ -2832,6 +2862,7 @@ void View::DrawZones()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AdjustThreadHeight( Vis( v ), oldOffset, offset );
|
||||
ImGui::PopClipRect();
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
{
|
||||
bool visible = true;
|
||||
bool showFull = true;
|
||||
bool ghost = false;
|
||||
int offset = 0;
|
||||
int height = 0;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user