1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-07 07:33:51 +00:00

Insert lock events into timeline.

This commit is contained in:
Bartosz Taudul 2017-10-04 19:24:24 +02:00
parent 9904ebb4b6
commit 39bb9a3ad1
2 changed files with 11 additions and 2 deletions

View File

@ -676,8 +676,17 @@ void View::InsertZone( Event* zone, Event* parent, Vector<Event*>& vec )
} }
} }
void View::InsertLockEvent( Vector<LockEvent*>& timeline, const LockEvent* lev ) void View::InsertLockEvent( Vector<LockEvent*>& timeline, LockEvent* lev )
{ {
if( timeline.empty() || timeline.back()->time < lev->time )
{
timeline.push_back( lev );
}
else
{
auto it = std::lower_bound( timeline.begin(), timeline.end(), lev->time, [] ( const auto& lhs, const auto& rhs ) { return lhs->time < rhs; } );
timeline.insert( it, lev );
}
} }
uint64_t View::GetFrameTime( size_t idx ) const uint64_t View::GetFrameTime( size_t idx ) const

View File

@ -84,7 +84,7 @@ private:
void InsertZone( Event* zone, Event* parent, Vector<Event*>& vec ); void InsertZone( Event* zone, Event* parent, Vector<Event*>& vec );
void InsertLockEvent( Vector<LockEvent*>& timeline, const LockEvent* lev ); void InsertLockEvent( Vector<LockEvent*>& timeline, LockEvent* lev );
uint64_t GetFrameTime( size_t idx ) const; uint64_t GetFrameTime( size_t idx ) const;
uint64_t GetFrameBegin( size_t idx ) const; uint64_t GetFrameBegin( size_t idx ) const;