mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Allow opening source files from withing call stack tree.
This commit is contained in:
parent
4e23ce9a24
commit
4c393a2b8d
@ -693,6 +693,7 @@ bool View::DrawImpl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_callstackBuzzAnim.Update( io.DeltaTime );
|
m_callstackBuzzAnim.Update( io.DeltaTime );
|
||||||
|
m_callstackTreeBuzzAnim.Update( io.DeltaTime );
|
||||||
|
|
||||||
return keepOpen;
|
return keepOpen;
|
||||||
}
|
}
|
||||||
@ -6496,6 +6497,7 @@ void View::DrawMemory()
|
|||||||
if( ImGui::TreeNode( "Call stack tree" ) )
|
if( ImGui::TreeNode( "Call stack tree" ) )
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled( "Press ctrl key to display allocation info tooltip." );
|
ImGui::TextDisabled( "Press ctrl key to display allocation info tooltip." );
|
||||||
|
ImGui::TextDisabled( "Right click on file name to open source file." );
|
||||||
|
|
||||||
auto& mem = m_worker.GetMemData();
|
auto& mem = m_worker.GetMemData();
|
||||||
auto tree = GetCallstackFrameTree( mem );
|
auto tree = GetCallstackFrameTree( mem );
|
||||||
@ -6509,7 +6511,7 @@ void View::DrawMemory()
|
|||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx ) const
|
void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx )
|
||||||
{
|
{
|
||||||
auto& io = ImGui::GetIO();
|
auto& io = ImGui::GetIO();
|
||||||
|
|
||||||
@ -6574,10 +6576,32 @@ void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx )
|
|||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( v.allocExclusive != v.allocInclusive )
|
float indentVal = 0.f;
|
||||||
|
if( m_callstackTreeBuzzAnim.Match( idx ) )
|
||||||
|
{
|
||||||
|
const auto time = m_callstackTreeBuzzAnim.Time();
|
||||||
|
indentVal = sin( time * 60.f ) * 10.f * time;
|
||||||
|
ImGui::SameLine( 0, ImGui::GetStyle().ItemSpacing.x + indentVal );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextDisabled( "%s:%i", m_worker.GetString( frame->file ), frame->line );
|
}
|
||||||
|
ImGui::TextDisabled( "%s:%i", m_worker.GetString( frame->file ), frame->line );
|
||||||
|
if( ImGui::IsItemClicked( 1 ) )
|
||||||
|
{
|
||||||
|
if( FileExists( m_worker.GetString( frame->file ) ) )
|
||||||
|
{
|
||||||
|
SetTextEditorFile( m_worker.GetString( frame->file ), frame->line );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_callstackTreeBuzzAnim.Enable( idx, 0.5f );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( v.allocExclusive != v.allocInclusive )
|
||||||
|
{
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextColored( ImVec4( 0.4, 0.4, 0.1, 1.0 ), "I:" );
|
ImGui::TextColored( ImVec4( 0.4, 0.4, 0.1, 1.0 ), "I:" );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|||||||
@ -103,7 +103,7 @@ private:
|
|||||||
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
||||||
|
|
||||||
std::vector<CallstackFrameTree> GetCallstackFrameTree( const MemData& mem ) const;
|
std::vector<CallstackFrameTree> GetCallstackFrameTree( const MemData& mem ) const;
|
||||||
void DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx ) const;
|
void DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx );
|
||||||
|
|
||||||
void DrawInfoWindow();
|
void DrawInfoWindow();
|
||||||
void DrawZoneInfoWindow();
|
void DrawZoneInfoWindow();
|
||||||
@ -238,6 +238,7 @@ private:
|
|||||||
Namespace m_namespace;
|
Namespace m_namespace;
|
||||||
Animation m_zoomAnim;
|
Animation m_zoomAnim;
|
||||||
BuzzAnim<int> m_callstackBuzzAnim;
|
BuzzAnim<int> m_callstackBuzzAnim;
|
||||||
|
BuzzAnim<int> m_callstackTreeBuzzAnim;
|
||||||
|
|
||||||
Vector<const ZoneEvent*> m_zoneInfoStack;
|
Vector<const ZoneEvent*> m_zoneInfoStack;
|
||||||
Vector<const GpuEvent*> m_gpuInfoStack;
|
Vector<const GpuEvent*> m_gpuInfoStack;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user