mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Use TimelineContext for drawing GPU zones.
This commit is contained in:
parent
5743bff0af
commit
ee5d6f1adb
@ -191,7 +191,7 @@ int64_t TimelineItemGpu::RangeEnd() const
|
|||||||
|
|
||||||
bool TimelineItemGpu::DrawContents( const TimelineContext& ctx, int& offset )
|
bool TimelineItemGpu::DrawContents( const TimelineContext& ctx, int& offset )
|
||||||
{
|
{
|
||||||
return m_view.DrawGpu( *m_gpu, ctx.pxns, offset, ctx.wpos, ctx.hover, ctx.yMin, ctx.yMax );
|
return m_view.DrawGpu( ctx, *m_gpu, offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ public:
|
|||||||
bool DrawThread( const ThreadData& thread, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax, bool ghostMode );
|
bool DrawThread( const ThreadData& thread, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax, bool ghostMode );
|
||||||
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 TimelineContext& ctx, const GpuCtxData& gpu, int& offset );
|
||||||
bool DrawCpuData( const TimelineContext& ctx, int& offset );
|
bool DrawCpuData( const TimelineContext& ctx, int& offset );
|
||||||
|
|
||||||
bool m_showRanges = false;
|
bool m_showRanges = false;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "TracyImGui.hpp"
|
#include "TracyImGui.hpp"
|
||||||
#include "TracyMouse.hpp"
|
#include "TracyMouse.hpp"
|
||||||
#include "TracyPrint.hpp"
|
#include "TracyPrint.hpp"
|
||||||
|
#include "TracyTimelineContext.hpp"
|
||||||
#include "TracyView.hpp"
|
#include "TracyView.hpp"
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
@ -9,14 +10,20 @@ namespace tracy
|
|||||||
|
|
||||||
constexpr float MinVisSize = 3;
|
constexpr float MinVisSize = 3;
|
||||||
|
|
||||||
bool View::DrawGpu( const GpuCtxData& gpu, double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax )
|
bool View::DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset )
|
||||||
{
|
{
|
||||||
const auto w = ImGui::GetContentRegionAvail().x - 1;
|
const auto w = ctx.w;
|
||||||
const auto ty = ImGui::GetTextLineHeight();
|
const auto ty = ctx.ty;
|
||||||
const auto ostep = ty + 1;
|
const auto ostep = ty + 1;
|
||||||
const auto nspx = 1.0 / pxns;
|
const auto pxns = ctx.pxns;
|
||||||
auto draw = ImGui::GetWindowDrawList();
|
const auto nspx = ctx.nspx;
|
||||||
|
const auto& wpos = ctx.wpos;
|
||||||
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
const auto dpos = wpos + ImVec2( 0.5f, 0.5f );
|
||||||
|
const auto hover = ctx.hover;
|
||||||
|
const auto yMin = ctx.yMin;
|
||||||
|
const auto yMax = ctx.yMax;
|
||||||
|
|
||||||
|
auto draw = ImGui::GetWindowDrawList();
|
||||||
|
|
||||||
ImGui::PushFont( m_smallFont );
|
ImGui::PushFont( m_smallFont );
|
||||||
const auto sty = ImGui::GetTextLineHeight();
|
const auto sty = ImGui::GetTextLineHeight();
|
||||||
|
Loading…
Reference in New Issue
Block a user