mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +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;
|
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
|
const char* View::TimeToString( uint64_t ns ) const
|
||||||
{
|
{
|
||||||
enum { Pool = 4 };
|
enum { Pool = 4 };
|
||||||
@ -901,7 +908,7 @@ void View::DrawZones()
|
|||||||
auto& ev = **it;
|
auto& ev = **it;
|
||||||
const auto& srcFile = m_srcFile[ev.srcloc];
|
const auto& srcFile = m_srcFile[ev.srcloc];
|
||||||
const char* func = GetString( srcFile.function );
|
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 zsz = ( ev.end - ev.start ) * pxns;
|
||||||
const auto tsz = ImGui::CalcTextSize( func );
|
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 );
|
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 GetFrameBegin( size_t idx ) const;
|
||||||
uint64_t GetFrameEnd( size_t idx ) const;
|
uint64_t GetFrameEnd( size_t idx ) const;
|
||||||
uint64_t GetLastTime() const;
|
uint64_t GetLastTime() const;
|
||||||
|
uint64_t GetZoneEnd( const Event& ev ) const;
|
||||||
const char* TimeToString( uint64_t ns ) const;
|
const char* TimeToString( uint64_t ns ) const;
|
||||||
const char* GetString( uint64_t ptr ) const;
|
const char* GetString( uint64_t ptr ) const;
|
||||||
const char* GetThreadString( uint64_t id ) const;
|
const char* GetThreadString( uint64_t id ) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user