mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Implement zone update code.
This commit is contained in:
parent
6419cd5062
commit
d98e08b37a
@ -365,6 +365,20 @@ void View::NewZone( Event* zone, uint64_t thread )
|
||||
void View::UpdateZone( Event* zone )
|
||||
{
|
||||
assert( zone->end != -1 );
|
||||
auto it = std::upper_bound( zone->child.begin(), zone->child.end(), zone->end, [] ( const auto& l, const auto& r ) { return l < r->start; } );
|
||||
if( it == zone->child.end() ) return;
|
||||
|
||||
// here be dragons
|
||||
auto& pvec = GetParentVector( *zone );
|
||||
auto pit = std::lower_bound( pvec.begin(), pvec.end(), zone->start, [] ( const auto& l, const auto& r ) { return l->start < r; } );
|
||||
assert( *pit == zone );
|
||||
++pit;
|
||||
for( auto eit = it; eit != zone->child.end(); ++eit )
|
||||
{
|
||||
(*eit)->parent = zone->parent;
|
||||
pit = pvec.insert( pit, *eit );
|
||||
}
|
||||
zone->child.erase( it, zone->child.end() );
|
||||
}
|
||||
|
||||
void View::InsertZone( Event* zone, Event* parent, Vector<Event*>& vec )
|
||||
|
Loading…
Reference in New Issue
Block a user