Allow displaying self zone time in frames overview.

This commit is contained in:
Bartosz Taudul 2020-05-25 01:15:06 +02:00
parent 74a79a6921
commit bdba77c0f5

View File

@ -1509,6 +1509,18 @@ void View::DrawFrames()
{ {
auto itEnd = std::lower_bound( itStart, zoneData.zones.end(), f1, [] ( const auto& l, const auto& r ) { return l.Zone()->Start() < r; } ); auto itEnd = std::lower_bound( itStart, zoneData.zones.end(), f1, [] ( const auto& l, const auto& r ) { return l.Zone()->Start() < r; } );
if( m_frames->continuous ) if( m_frames->continuous )
{
if( m_findZone.selfTime )
{
while( itStart != itEnd )
{
const auto t0 = clamp( itStart->Zone()->Start(), f0, f1 );
const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), f0, f1 );
zoneTime += t1 - t0 - GetZoneChildTimeFastClamped( *itStart->Zone(), t0, t1 );
itStart++;
}
}
else
{ {
while( itStart != itEnd ) while( itStart != itEnd )
{ {
@ -1518,6 +1530,25 @@ void View::DrawFrames()
itStart++; itStart++;
} }
} }
}
else
{
if( m_findZone.selfTime )
{
while( itStart != itEnd )
{
const int g = std::min( group, total - ( m_vd.frameStart + idx ) );
for( int j=0; j<g; j++ )
{
const auto ft0 = m_worker.GetFrameBegin( *m_frames, m_vd.frameStart + idx + j );
const auto ft1 = m_worker.GetFrameEnd( *m_frames, m_vd.frameStart + idx + j );
const auto t0 = clamp( itStart->Zone()->Start(), ft0, ft1 );
const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), ft0, ft1 );
zoneTime += t1 - t0 - GetZoneChildTimeFastClamped( *itStart->Zone(), t0, t1 );
}
itStart++;
}
}
else else
{ {
while( itStart != itEnd ) while( itStart != itEnd )
@ -1535,6 +1566,7 @@ void View::DrawFrames()
} }
} }
} }
}
else else
{ {
begin = itStart; begin = itStart;