mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Non-user plots must have predefined names.
This commit is contained in:
parent
d8bfe7de2e
commit
afa432a087
@ -2392,7 +2392,7 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
|
||||
{
|
||||
draw->AddTriangle( wpos + ImVec2( to/2, offset + to/2 ), wpos + ImVec2( to/2, offset + ty - to/2 ), wpos + ImVec2( to/2 + th, offset + ty * 0.5 ), 0xFF226E6E );
|
||||
}
|
||||
const auto txt = m_worker.GetString( v->name );
|
||||
const auto txt = GetPlotName( v );
|
||||
draw->AddText( wpos + ImVec2( ty, offset ), showFull ? 0xFF44DDDD : 0xFF226E6E, txt );
|
||||
draw->AddLine( wpos + ImVec2( 0, offset + ty - 1 ), wpos + ImVec2( w, offset + ty - 1 ), 0x8844DDDD );
|
||||
|
||||
@ -3014,7 +3014,7 @@ void View::DrawOptions()
|
||||
{
|
||||
for( const auto& p : m_worker.GetPlots() )
|
||||
{
|
||||
ImGui::Checkbox( m_worker.GetString( p->name ), &Visible( p ) );
|
||||
ImGui::Checkbox( GetPlotName( p ), &Visible( p ) );
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
@ -4907,6 +4907,20 @@ Vector<int8_t> View::GetMemoryPages() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char* View::GetPlotName( const PlotData* plot ) const
|
||||
{
|
||||
switch( plot->type )
|
||||
{
|
||||
case PlotType::User:
|
||||
return m_worker.GetString( plot->name );
|
||||
case PlotType::Memory:
|
||||
return "Memory usage";
|
||||
default:
|
||||
assert( false );
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t View::GetZoneColor( const ZoneEvent& ev )
|
||||
{
|
||||
const auto& srcloc = m_worker.GetSourceLocation( ev.srcloc );
|
||||
|
@ -116,6 +116,7 @@ private:
|
||||
#endif
|
||||
|
||||
Vector<int8_t> GetMemoryPages() const;
|
||||
const char* GetPlotName( const PlotData* plot ) const;
|
||||
|
||||
flat_hash_map<const void*, bool, nohash<const void*>> m_visible;
|
||||
flat_hash_map<const void*, bool, nohash<const void*>> m_showFull;
|
||||
|
Loading…
Reference in New Issue
Block a user