mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 04:01: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 )
|
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 DrawThreadMessages( const ThreadData& thread, double pxns, int offset, const ImVec2& wpos, bool hover );
|
||||||
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 GpuCtxData& gpu, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
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;
|
bool m_showRanges = false;
|
||||||
Range m_statRange;
|
Range m_statRange;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "TracyMouse.hpp"
|
#include "TracyMouse.hpp"
|
||||||
#include "TracyPrint.hpp"
|
#include "TracyPrint.hpp"
|
||||||
#include "TracyTimelineItem.hpp"
|
#include "TracyTimelineItem.hpp"
|
||||||
|
#include "TracyTimelineContext.hpp"
|
||||||
#include "TracyView.hpp"
|
#include "TracyView.hpp"
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
@ -12,18 +13,24 @@ namespace tracy
|
|||||||
|
|
||||||
constexpr float MinVisSize = 3;
|
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();
|
auto cpuData = m_worker.GetCpuData();
|
||||||
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
|
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
|
||||||
assert( cpuCnt != 0 );
|
assert( cpuCnt != 0 );
|
||||||
|
|
||||||
const auto w = ImGui::GetContentRegionAvail().x - 1;
|
const auto& wpos = ctx.wpos;
|
||||||
const auto ty = ImGui::GetTextLineHeight();
|
const auto w = ctx.w;
|
||||||
const auto nspxdbl = 1.0 / pxns;
|
const auto ty = ctx.ty;
|
||||||
|
const auto pxns = ctx.pxns;
|
||||||
|
const auto nspxdbl = ctx.nspx;
|
||||||
const auto nspx = int64_t( nspxdbl );
|
const auto nspx = int64_t( nspxdbl );
|
||||||
auto draw = ImGui::GetWindowDrawList();
|
|
||||||
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
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
|
#ifdef TRACY_NO_STATISTICS
|
||||||
if( m_vd.drawCpuUsageGraph )
|
if( m_vd.drawCpuUsageGraph )
|
||||||
|
Loading…
Reference in New Issue
Block a user