1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Remove CPU migration highlight for zones.

This commit is contained in:
Bartosz Taudul 2019-06-26 21:35:09 +02:00
parent 3bf23e15bb
commit fc106079c5
2 changed files with 3 additions and 34 deletions

View File

@ -1825,7 +1825,6 @@ void View::DrawZones()
offset += ostep;
if( showFull )
{
m_lastCpu = -1;
if( m_drawZones )
{
depth = DispatchZoneLevel( v->timeline, hover, pxns, int64_t( nspx ), wpos, offset, 0, yMin, yMax );
@ -2256,28 +2255,12 @@ int View::DrawZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
const char* zoneName = m_worker.GetZoneName( ev );
int dmul = ev.text.active ? 2 : 1;
bool migration = false;
if( m_lastCpu != ev.cpu_start )
{
if( m_lastCpu >= 0 )
{
migration = true;
}
m_lastCpu = ev.cpu_start;
}
if( ev.child >= 0 )
{
const auto d = DispatchZoneLevel( m_worker.GetZoneChildren( ev.child ), hover, pxns, nspx, wpos, _offset, depth, yMin, yMax );
if( d > maxdepth ) maxdepth = d;
}
if( ev.end >= 0 && m_lastCpu != ev.cpu_end )
{
m_lastCpu = ev.cpu_end;
migration = true;
}
auto tsz = ImGui::CalcTextSize( zoneName );
if( tsz.x > zsz )
{
@ -2290,7 +2273,7 @@ int View::DrawZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
const auto px0 = std::max( pr0, -10.0 );
const auto px1 = std::max( { std::min( pr1, double( w + 10 ) ), px0 + pxns * 0.5, px0 + MinVisSize } );
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), color );
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), GetZoneHighlight( ev, migration ), 0.f, -1, GetZoneThickness( ev ) );
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), GetZoneHighlight( ev ), 0.f, -1, GetZoneThickness( ev ) );
if( dsz * dmul > MinVisSize )
{
const auto diff = dsz * dmul - MinVisSize;
@ -2422,19 +2405,11 @@ int View::SkipZoneLevel( const Vector<ZoneEvent*>& vec, bool hover, double pxns,
}
else
{
m_lastCpu = ev.cpu_start;
if( ev.child >= 0 )
{
const auto d = DispatchZoneLevel( m_worker.GetZoneChildren( ev.child ), hover, pxns, nspx, wpos, _offset, depth, yMin, yMax );
if( d > maxdepth ) maxdepth = d;
}
if( ev.end >= 0 && m_lastCpu != ev.cpu_end )
{
m_lastCpu = ev.cpu_end;
}
++it;
}
}
@ -10207,7 +10182,7 @@ uint32_t View::GetZoneColor( const GpuEvent& ev )
return color != 0 ? ( color | 0xFF000000 ) : 0xFF222288;
}
uint32_t View::GetZoneHighlight( const ZoneEvent& ev, bool migration )
uint32_t View::GetZoneHighlight( const ZoneEvent& ev )
{
if( m_zoneInfoWindow == &ev )
{
@ -10221,10 +10196,6 @@ uint32_t View::GetZoneHighlight( const ZoneEvent& ev, bool migration )
{
return 0xFFEEEEEE;
}
else if( migration )
{
return 0xFFDD22DD;
}
else
{
const auto color = GetZoneColor( ev );

View File

@ -150,7 +150,7 @@ private:
uint32_t GetZoneColor( const ZoneEvent& ev );
uint32_t GetZoneColor( const GpuEvent& ev );
uint32_t GetZoneHighlight( const ZoneEvent& ev, bool migration );
uint32_t GetZoneHighlight( const ZoneEvent& ev );
uint32_t GetZoneHighlight( const GpuEvent& ev );
float GetZoneThickness( const ZoneEvent& ev );
float GetZoneThickness( const GpuEvent& ev );
@ -243,8 +243,6 @@ private:
int64_t m_zvStart = 0;
int64_t m_zvEnd = 0;
int8_t m_lastCpu;
int m_zvHeight = 0;
int m_zvScroll = 0;