1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Proper way to get full frame count.

This commit is contained in:
Bartosz Taudul
2018-09-01 12:38:12 +02:00
parent faea036c16
commit 9f4d6692dc
3 changed files with 32 additions and 1 deletions
+30
View File
@@ -953,6 +953,36 @@ uint64_t Worker::GetPlotCount() const
return cnt;
}
size_t Worker::GetFullFrameCount( const FrameData& fd ) const
{
const auto sz = fd.frames.size();
assert( sz != 0 );
if( fd.continuous )
{
if( IsConnected() )
{
return sz - 1;
}
else
{
return sz;
}
}
else
{
const auto& last = fd.frames.back();
if( last.end >= 0 )
{
return sz;
}
else
{
return sz - 1;
}
}
}
int64_t Worker::GetFrameTime( const FrameData& fd, size_t idx ) const
{
if( fd.continuous )