mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Use TimelineContext when drawing CPU data.
This commit is contained in:
parent
26791f55d1
commit
5743bff0af
@ -41,7 +41,7 @@ int64_t TimelineItemCpuData::RangeEnd() const
|
||||
|
||||
bool TimelineItemCpuData::DrawContents( const TimelineContext& ctx, int& offset )
|
||||
{
|
||||
return m_view.DrawCpuData( ctx.pxns, offset, ctx.wpos, ctx.hover, ctx.yMin, ctx.yMax );
|
||||
return m_view.DrawCpuData( ctx, offset );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
void DrawThreadMessages( const ThreadData& thread, double pxns, int offset, const ImVec2& wpos, bool hover );
|
||||
void DrawThreadOverlays( const ThreadData& thread, const ImVec2& ul, const ImVec2& dr );
|
||||
bool DrawGpu( const GpuCtxData& gpu, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
||||
bool DrawCpuData( double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
||||
bool DrawCpuData( const TimelineContext& ctx, int& offset );
|
||||
|
||||
bool m_showRanges = false;
|
||||
Range m_statRange;
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "TracyMouse.hpp"
|
||||
#include "TracyPrint.hpp"
|
||||
#include "TracyTimelineItem.hpp"
|
||||
#include "TracyTimelineContext.hpp"
|
||||
#include "TracyView.hpp"
|
||||
|
||||
namespace tracy
|
||||
@ -12,18 +13,24 @@ namespace tracy
|
||||
|
||||
constexpr float MinVisSize = 3;
|
||||
|
||||
bool View::DrawCpuData( double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax )
|
||||
bool View::DrawCpuData( const TimelineContext& ctx, int& offset )
|
||||
{
|
||||
auto cpuData = m_worker.GetCpuData();
|
||||
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
|
||||
assert( cpuCnt != 0 );
|
||||
|
||||
const auto w = ImGui::GetContentRegionAvail().x - 1;
|
||||
const auto ty = ImGui::GetTextLineHeight();
|
||||
const auto nspxdbl = 1.0 / pxns;
|
||||
const auto& wpos = ctx.wpos;
|
||||
const auto w = ctx.w;
|
||||
const auto ty = ctx.ty;
|
||||
const auto pxns = ctx.pxns;
|
||||
const auto nspxdbl = ctx.nspx;
|
||||
const auto nspx = int64_t( nspxdbl );
|
||||
auto draw = ImGui::GetWindowDrawList();
|
||||
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
||||
const auto yMin = ctx.yMin;
|
||||
const auto yMax = ctx.yMax;
|
||||
const auto hover = ctx.hover;
|
||||
|
||||
auto draw = ImGui::GetWindowDrawList();
|
||||
|
||||
#ifdef TRACY_NO_STATISTICS
|
||||
if( m_vd.drawCpuUsageGraph )
|
||||
|
Loading…
Reference in New Issue
Block a user