mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Extract call stack calls drawing functionality.
This commit is contained in:
parent
a518564006
commit
973fd941d5
@ -7787,31 +7787,7 @@ void View::DrawMessages()
|
|||||||
SmallCallstackButton( "Show", cs, idx );
|
SmallCallstackButton( "Show", cs, idx );
|
||||||
#endif
|
#endif
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
const auto& csdata = m_worker.GetCallstack( cs );
|
DrawCallstackCalls( cs, 4 );
|
||||||
const auto cssz = std::min<int>( csdata.size(), 4 );
|
|
||||||
bool first = true;
|
|
||||||
for( int i=0; i<cssz; i++ )
|
|
||||||
{
|
|
||||||
const auto frameData = m_worker.GetCallstackFrame( csdata[i] );
|
|
||||||
if( !frameData ) break;
|
|
||||||
if( first )
|
|
||||||
{
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ImGui::SameLine();
|
|
||||||
#ifdef TRACY_EXTENDED_FONT
|
|
||||||
TextDisabledUnformatted( ICON_FA_LONG_ARROW_ALT_LEFT );
|
|
||||||
#else
|
|
||||||
TextDisabledUnformatted( "<-" );
|
|
||||||
#endif
|
|
||||||
ImGui::SameLine();
|
|
||||||
}
|
|
||||||
const auto& frame = frameData->data[frameData->size - 1];
|
|
||||||
auto txt = m_worker.GetString( frame.name );
|
|
||||||
ImGui::TextUnformatted( txt );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
msgcnt++;
|
msgcnt++;
|
||||||
@ -13967,6 +13943,35 @@ void View::SmallCallstackButton( const char* name, uint32_t callstack, int& idx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::DrawCallstackCalls( uint32_t callstack, uint8_t limit ) const
|
||||||
|
{
|
||||||
|
const auto& csdata = m_worker.GetCallstack( callstack );
|
||||||
|
const auto cssz = std::min( csdata.size(), limit );
|
||||||
|
bool first = true;
|
||||||
|
for( uint8_t i=0; i<cssz; i++ )
|
||||||
|
{
|
||||||
|
const auto frameData = m_worker.GetCallstackFrame( csdata[i] );
|
||||||
|
if( !frameData ) break;
|
||||||
|
if( first )
|
||||||
|
{
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
#ifdef TRACY_EXTENDED_FONT
|
||||||
|
TextDisabledUnformatted( ICON_FA_LONG_ARROW_ALT_LEFT );
|
||||||
|
#else
|
||||||
|
TextDisabledUnformatted( "<-" );
|
||||||
|
#endif
|
||||||
|
ImGui::SameLine();
|
||||||
|
}
|
||||||
|
const auto& frame = frameData->data[frameData->size - 1];
|
||||||
|
auto txt = m_worker.GetString( frame.name );
|
||||||
|
ImGui::TextUnformatted( txt );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void View::SetViewToLastFrames()
|
void View::SetViewToLastFrames()
|
||||||
{
|
{
|
||||||
const int total = m_worker.GetFrameCount( *m_frames );
|
const int total = m_worker.GetFrameCount( *m_frames );
|
||||||
|
|||||||
@ -222,6 +222,7 @@ private:
|
|||||||
const char* GetPlotName( const PlotData* plot ) const;
|
const char* GetPlotName( const PlotData* plot ) const;
|
||||||
|
|
||||||
void SmallCallstackButton( const char* name, uint32_t callstack, int& idx, bool tooltip = true );
|
void SmallCallstackButton( const char* name, uint32_t callstack, int& idx, bool tooltip = true );
|
||||||
|
void DrawCallstackCalls( uint32_t callstack, uint8_t limit ) const;
|
||||||
void SetViewToLastFrames();
|
void SetViewToLastFrames();
|
||||||
int64_t GetZoneChildTime( const ZoneEvent& zone );
|
int64_t GetZoneChildTime( const ZoneEvent& zone );
|
||||||
int64_t GetZoneChildTime( const GpuEvent& zone );
|
int64_t GetZoneChildTime( const GpuEvent& zone );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user