mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Remove error indicators for CPU zones.
This commit is contained in:
parent
72b1ff6477
commit
798249c81c
@ -414,8 +414,6 @@ int TimelineItemThread::PreprocessZoneLevel( const TimelineContext& ctx, const V
|
||||
template<typename Adapter, typename V>
|
||||
int TimelineItemThread::PreprocessZoneLevel( const TimelineContext& ctx, const V& vec, int depth, bool visible )
|
||||
{
|
||||
const auto delay = m_worker.GetDelay();
|
||||
const auto resolution = m_worker.GetResolution();
|
||||
const auto vStart = ctx.vStart;
|
||||
const auto vEnd = ctx.vEnd;
|
||||
const auto nspx = ctx.nspx;
|
||||
@ -423,10 +421,10 @@ int TimelineItemThread::PreprocessZoneLevel( const TimelineContext& ctx, const V
|
||||
const auto MinVisNs = int64_t( round( GetScale() * MinVisSize * nspx ) );
|
||||
|
||||
// cast to uint64_t, so that unended zones (end = -1) are still drawn
|
||||
auto it = std::lower_bound( vec.begin(), vec.end(), std::max<int64_t>( 0, vStart - std::max<int64_t>( delay, 2 * MinVisNs ) ), [] ( const auto& l, const auto& r ) { Adapter a; return (uint64_t)a(l).End() < (uint64_t)r; } );
|
||||
auto it = std::lower_bound( vec.begin(), vec.end(), vStart, [] ( const auto& l, const auto& r ) { Adapter a; return (uint64_t)a(l).End() < (uint64_t)r; } );
|
||||
if( it == vec.end() ) return depth;
|
||||
|
||||
const auto zitend = std::lower_bound( it, vec.end(), vEnd + resolution, [] ( const auto& l, const auto& r ) { Adapter a; return a(l).Start() < r; } );
|
||||
const auto zitend = std::lower_bound( it, vec.end(), vEnd, [] ( const auto& l, const auto& r ) { Adapter a; return a(l).Start() < r; } );
|
||||
if( it == zitend ) return depth;
|
||||
Adapter a;
|
||||
if( !a(*it).IsEndValid() && m_worker.GetZoneEnd( a(*it) ) < vStart ) return depth;
|
||||
|
@ -211,12 +211,6 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
|
||||
const auto pxns = ctx.pxns;
|
||||
const auto hover = ctx.hover;
|
||||
const auto vStart = ctx.vStart;
|
||||
const auto dsz = m_worker.GetDelay() * pxns;
|
||||
const auto rsz = m_worker.GetResolution() * pxns;
|
||||
|
||||
const auto ty025 = round( ty * 0.25f );
|
||||
const auto ty05 = round( ty * 0.5f );
|
||||
const auto ty075 = round( ty * 0.75f );
|
||||
|
||||
for( auto& v : drawList )
|
||||
{
|
||||
@ -321,43 +315,6 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
|
||||
DrawLine( draw, dpos + ImVec2( px0, offset + tsz.y ), dpos + ImVec2( px0, offset ), dpos + ImVec2( px1-1, offset ), zoneColor.accentColor, zoneColor.thickness );
|
||||
DrawLine( draw, dpos + ImVec2( px0, offset + tsz.y ), dpos + ImVec2( px1-1, offset + tsz.y ), dpos + ImVec2( px1-1, offset ), darkColor, zoneColor.thickness );
|
||||
}
|
||||
if( dsz > MinVisSize )
|
||||
{
|
||||
const auto diff = dsz - MinVisSize;
|
||||
uint32_t color;
|
||||
if( diff < 1 )
|
||||
{
|
||||
color = ( uint32_t( diff * 0x88 ) << 24 ) | 0x2222DD;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = 0x882222DD;
|
||||
}
|
||||
|
||||
draw->AddRectFilled( wpos + ImVec2( pr0, offset ), wpos + ImVec2( std::min( pr0+dsz, pr1 ), offset + tsz.y ), color );
|
||||
draw->AddRectFilled( wpos + ImVec2( pr1, offset ), wpos + ImVec2( pr1+dsz, offset + tsz.y ), color );
|
||||
}
|
||||
if( rsz > MinVisSize )
|
||||
{
|
||||
const auto diff = rsz - MinVisSize;
|
||||
uint32_t color;
|
||||
if( diff < 1 )
|
||||
{
|
||||
color = ( uint32_t( diff * 0xAA ) << 24 ) | 0xFFFFFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = 0xAAFFFFFF;
|
||||
}
|
||||
|
||||
DrawLine( draw, dpos + ImVec2( pr0 + rsz, offset + ty05 ), dpos + ImVec2( pr0 - rsz, offset + ty05 ), color );
|
||||
DrawLine( draw, dpos + ImVec2( pr0 + rsz, offset + ty025 ), dpos + ImVec2( pr0 + rsz, offset + ty075 ), color );
|
||||
DrawLine( draw, dpos + ImVec2( pr0 - rsz, offset + ty025 ), dpos + ImVec2( pr0 - rsz, offset + ty075 ), color );
|
||||
|
||||
DrawLine( draw, dpos + ImVec2( pr1 + rsz, offset + ty05 ), dpos + ImVec2( pr1 - rsz, offset + ty05 ), color );
|
||||
DrawLine( draw, dpos + ImVec2( pr1 + rsz, offset + ty025 ), dpos + ImVec2( pr1 + rsz, offset + ty075 ), color );
|
||||
DrawLine( draw, dpos + ImVec2( pr1 - rsz, offset + ty025 ), dpos + ImVec2( pr1 - rsz, offset + ty075 ), color );
|
||||
}
|
||||
if( tsz.x < zsz )
|
||||
{
|
||||
const auto x = ( ev.Start() - m_vd.zvStart ) * pxns + ( ( end - ev.Start() ) * pxns - tsz.x ) / 2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user