mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 14:03:52 +00:00
Allow disabling average, median markers on frame set histogram.
This commit is contained in:
parent
0b0fa919d3
commit
a02121d78a
@ -6588,6 +6588,8 @@ void View::DrawInfo()
|
|||||||
|
|
||||||
TextFocused( "Max counts:", RealToString( maxVal, true ) );
|
TextFocused( "Max counts:", RealToString( maxVal, true ) );
|
||||||
|
|
||||||
|
ImGui::Checkbox( "###draw1", &m_frameSortData.drawAvgMed );
|
||||||
|
ImGui::SameLine();
|
||||||
ImGui::ColorButton( "c1", ImVec4( 0xFF/255.f, 0x44/255.f, 0x44/255.f, 1.f ), ImGuiColorEditFlags_NoTooltip );
|
ImGui::ColorButton( "c1", ImVec4( 0xFF/255.f, 0x44/255.f, 0x44/255.f, 1.f ), ImGuiColorEditFlags_NoTooltip );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text( "Average time" );
|
ImGui::Text( "Average time" );
|
||||||
@ -6720,31 +6722,34 @@ void View::DrawInfo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float ta, tm;
|
if( m_frameSortData.drawAvgMed )
|
||||||
if( m_frameSortData.logTime )
|
|
||||||
{
|
{
|
||||||
const auto ltmin = log10fast( tmin );
|
float ta, tm;
|
||||||
const auto ltmax = log10fast( tmax );
|
if( m_frameSortData.logTime )
|
||||||
|
{
|
||||||
|
const auto ltmin = log10fast( tmin );
|
||||||
|
const auto ltmax = log10fast( tmax );
|
||||||
|
|
||||||
ta = ( log10fast( m_frameSortData.average ) - ltmin ) / float( ltmax - ltmin ) * numBins;
|
ta = ( log10fast( m_frameSortData.average ) - ltmin ) / float( ltmax - ltmin ) * numBins;
|
||||||
tm = ( log10fast( m_frameSortData.median ) - ltmin ) / float( ltmax - ltmin ) * numBins;
|
tm = ( log10fast( m_frameSortData.median ) - ltmin ) / float( ltmax - ltmin ) * numBins;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ta = ( m_frameSortData.average - tmin ) / float( tmax - tmin ) * numBins;
|
ta = ( m_frameSortData.average - tmin ) / float( tmax - tmin ) * numBins;
|
||||||
tm = ( m_frameSortData.median - tmin ) / float( tmax - tmin ) * numBins;
|
tm = ( m_frameSortData.median - tmin ) / float( tmax - tmin ) * numBins;
|
||||||
}
|
}
|
||||||
ta = round( ta );
|
ta = round( ta );
|
||||||
tm = round( tm );
|
tm = round( tm );
|
||||||
|
|
||||||
if( ta == tm )
|
if( ta == tm )
|
||||||
{
|
{
|
||||||
draw->AddLine( ImVec2( wpos.x + ta, wpos.y ), ImVec2( wpos.x + ta, wpos.y+Height-2 ), 0xFFFF88FF );
|
draw->AddLine( ImVec2( wpos.x + ta, wpos.y ), ImVec2( wpos.x + ta, wpos.y+Height-2 ), 0xFFFF88FF );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
draw->AddLine( ImVec2( wpos.x + ta, wpos.y ), ImVec2( wpos.x + ta, wpos.y+Height-2 ), 0xFF4444FF );
|
draw->AddLine( ImVec2( wpos.x + ta, wpos.y ), ImVec2( wpos.x + ta, wpos.y+Height-2 ), 0xFF4444FF );
|
||||||
draw->AddLine( ImVec2( wpos.x + tm, wpos.y ), ImVec2( wpos.x + tm, wpos.y+Height-2 ), 0xFFFF8844 );
|
draw->AddLine( ImVec2( wpos.x + tm, wpos.y ), ImVec2( wpos.x + tm, wpos.y+Height-2 ), 0xFFFF8844 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 2, 2 ), wpos + ImVec2( w-2, Height + round( ty * 1.5 ) ) ) )
|
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 2, 2 ), wpos + ImVec2( w-2, Height + round( ty * 1.5 ) ) ) )
|
||||||
|
@ -396,6 +396,7 @@ private:
|
|||||||
bool logTime = true;
|
bool logTime = true;
|
||||||
int64_t numBins = -1;
|
int64_t numBins = -1;
|
||||||
std::unique_ptr<int64_t[]> bins;
|
std::unique_ptr<int64_t[]> bins;
|
||||||
|
bool drawAvgMed = true;
|
||||||
} m_frameSortData;
|
} m_frameSortData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user