mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Take children into account when determining zone end.
This commit is contained in:
parent
3f765002c1
commit
3d6e85db4a
@ -435,6 +435,13 @@ uint64_t View::GetLastTime() const
|
||||
return last;
|
||||
}
|
||||
|
||||
uint64_t View::GetZoneEnd( const Event& ev ) const
|
||||
{
|
||||
if( ev.end != -1 ) return ev.end;
|
||||
if( ev.child.empty() ) return ev.start;
|
||||
return GetZoneEnd( *ev.child.back() );
|
||||
}
|
||||
|
||||
const char* View::TimeToString( uint64_t ns ) const
|
||||
{
|
||||
enum { Pool = 4 };
|
||||
@ -901,7 +908,7 @@ void View::DrawZones()
|
||||
auto& ev = **it;
|
||||
const auto& srcFile = m_srcFile[ev.srcloc];
|
||||
const char* func = GetString( srcFile.function );
|
||||
const auto end = ev.end != -1 ? ev.end : ev.start;
|
||||
const auto end = GetZoneEnd( ev );
|
||||
const auto zsz = ( ev.end - ev.start ) * pxns;
|
||||
const auto tsz = ImGui::CalcTextSize( func );
|
||||
draw->AddRectFilled( wpos + ImVec2( ( ev.start - m_zvStart ) * pxns, offset ), wpos + ImVec2( ( end - m_zvStart ) * pxns, offset + tsz.y ), 0xDDDD6666, 2.f );
|
||||
|
@ -61,6 +61,7 @@ private:
|
||||
uint64_t GetFrameBegin( size_t idx ) const;
|
||||
uint64_t GetFrameEnd( size_t idx ) const;
|
||||
uint64_t GetLastTime() const;
|
||||
uint64_t GetZoneEnd( const Event& ev ) const;
|
||||
const char* TimeToString( uint64_t ns ) const;
|
||||
const char* GetString( uint64_t ptr ) const;
|
||||
const char* GetThreadString( uint64_t id ) const;
|
||||
|
Loading…
Reference in New Issue
Block a user