mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Decouple CPU graph availability from having the draw data.
This commit is contained in:
parent
9500add83b
commit
f2a2669ca8
@ -41,7 +41,8 @@ int64_t TimelineItemCpuData::RangeEnd() const
|
|||||||
|
|
||||||
bool TimelineItemCpuData::DrawContents( const TimelineContext& ctx, int& offset )
|
bool TimelineItemCpuData::DrawContents( const TimelineContext& ctx, int& offset )
|
||||||
{
|
{
|
||||||
m_view.DrawCpuData( ctx, m_cpuDraw, m_ctxDraw, offset );
|
const bool hasCpuData = m_worker.IsCpuUsageReady() && !m_worker.GetCpuUsage().empty();
|
||||||
|
m_view.DrawCpuData( ctx, m_cpuDraw, m_ctxDraw, offset, hasCpuData );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ public:
|
|||||||
void DrawThreadMessagesList( const TimelineContext& ctx, const std::vector<MessagesDraw>& drawList, int offset, uint64_t tid );
|
void DrawThreadMessagesList( const TimelineContext& ctx, const std::vector<MessagesDraw>& drawList, int offset, uint64_t tid );
|
||||||
void DrawThreadOverlays( const ThreadData& thread, const ImVec2& ul, const ImVec2& dr );
|
void DrawThreadOverlays( const ThreadData& thread, const ImVec2& ul, const ImVec2& dr );
|
||||||
bool DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset );
|
bool DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset );
|
||||||
bool DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset );
|
bool DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset, bool hasCpuData );
|
||||||
|
|
||||||
bool m_showRanges = false;
|
bool m_showRanges = false;
|
||||||
Range m_statRange;
|
Range m_statRange;
|
||||||
|
@ -14,7 +14,7 @@ constexpr float MinVisSize = 3;
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
bool View::DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset )
|
bool View::DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset, bool hasCpuData )
|
||||||
{
|
{
|
||||||
auto cpuData = m_worker.GetCpuData();
|
auto cpuData = m_worker.GetCpuData();
|
||||||
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
|
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
|
||||||
@ -34,7 +34,7 @@ bool View::DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDr
|
|||||||
|
|
||||||
auto draw = ImGui::GetWindowDrawList();
|
auto draw = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
if( m_vd.drawCpuUsageGraph && !cpuDraw.empty() )
|
if( hasCpuData && m_vd.drawCpuUsageGraph )
|
||||||
{
|
{
|
||||||
const auto cpuUsageHeight = floor( 30.f * GetScale() );
|
const auto cpuUsageHeight = floor( 30.f * GetScale() );
|
||||||
if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax )
|
if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax )
|
||||||
|
Loading…
Reference in New Issue
Block a user