Use draw list data to draw locks.

This commit is contained in:
Bartosz Taudul 2023-04-15 22:47:32 +02:00
parent 788d9b77fc
commit 5aaa4fcaf7
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 308 additions and 702 deletions

View File

@ -230,7 +230,7 @@ private:
template<typename Adapter, typename V> template<typename Adapter, typename V>
int SkipGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); int SkipGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift );
void DrawLockHeader( uint32_t id, const LockMap& lockmap, const SourceLocation& srcloc, bool hover, ImDrawList* draw, const ImVec2& wpos, float w, float ty, float offset, uint8_t tid ); void DrawLockHeader( uint32_t id, const LockMap& lockmap, const SourceLocation& srcloc, bool hover, ImDrawList* draw, const ImVec2& wpos, float w, float ty, float offset, uint8_t tid );
int DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, int offset, LockHighlight& highlight, float yMin, float yMax ); int DrawLocks( const TimelineContext& ctx, const std::vector<std::unique_ptr<LockDraw>>& lockDraw, uint64_t tid, int _offset, LockHighlight& highlight );
void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, const PlotItem* item, double prev, bool merged, PlotType type, PlotValueFormatting format, float PlotHeight, uint64_t name ); void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, const PlotItem* item, double prev, bool merged, PlotType type, PlotValueFormatting format, float PlotHeight, uint64_t name );
void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, double val, double prev, bool merged, PlotValueFormatting format, float PlotHeight ); void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, double val, double prev, bool merged, PlotValueFormatting format, float PlotHeight );
void DrawOptions(); void DrawOptions();

File diff suppressed because it is too large Load Diff

View File

@ -28,8 +28,6 @@ void View::DrawThread( const TimelineContext& ctx, const ThreadData& thread, con
const auto& wpos = ctx.wpos; const auto& wpos = ctx.wpos;
const auto ty = ctx.ty; const auto ty = ctx.ty;
const auto ostep = ty + 1; const auto ostep = ty + 1;
const auto pxns = ctx.pxns;
const auto hover = ctx.hover;
const auto yMin = ctx.yMin; const auto yMin = ctx.yMin;
const auto yMax = ctx.yMax; const auto yMax = ctx.yMax;
const auto sty = ctx.sty; const auto sty = ctx.sty;
@ -77,7 +75,7 @@ void View::DrawThread( const TimelineContext& ctx, const ThreadData& thread, con
if( m_vd.drawLocks ) if( m_vd.drawLocks )
{ {
const auto lockDepth = DrawLocks( thread.id, hover, pxns, wpos, offset, m_nextLockHighlight, yMin, yMax ); const auto lockDepth = DrawLocks( ctx, lockDraw, thread.id, offset, m_nextLockHighlight );
offset += sstep * lockDepth; offset += sstep * lockDepth;
depth += lockDepth; depth += lockDepth;
} }