mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +00:00
Use precalculated start times.
This commit is contained in:
parent
9d2f874b02
commit
ceeea7712d
@ -277,8 +277,8 @@ private:
|
|||||||
void DrawWaitStacks();
|
void DrawWaitStacks();
|
||||||
void DrawFlameGraph();
|
void DrawFlameGraph();
|
||||||
void DrawFlameGraphHeader( uint64_t timespan );
|
void DrawFlameGraphHeader( uint64_t timespan );
|
||||||
void DrawFlameGraphLevel( const std::vector<FlameGraphItem>& data, FlameGraphContext& ctx, uint64_t ts, int depth, bool samples );
|
void DrawFlameGraphLevel( const std::vector<FlameGraphItem>& data, FlameGraphContext& ctx, int depth, bool samples );
|
||||||
void DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ctx, uint64_t ts, int depth, bool samples );
|
void DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ctx, int depth, bool samples );
|
||||||
void BuildFlameGraph( const Worker& worker, std::vector<FlameGraphItem>& data, const Vector<short_ptr<ZoneEvent>>& zones );
|
void BuildFlameGraph( const Worker& worker, std::vector<FlameGraphItem>& data, const Vector<short_ptr<ZoneEvent>>& zones );
|
||||||
void BuildFlameGraph( const Worker& worker, std::vector<FlameGraphItem>& data, const Vector<short_ptr<ZoneEvent>>& zones, const ContextSwitch* ctx );
|
void BuildFlameGraph( const Worker& worker, std::vector<FlameGraphItem>& data, const Vector<short_ptr<ZoneEvent>>& zones, const ContextSwitch* ctx );
|
||||||
void BuildFlameGraph( const Worker& worker, std::vector<FlameGraphItem>& data, const Vector<SampleData>& samples );
|
void BuildFlameGraph( const Worker& worker, std::vector<FlameGraphItem>& data, const Vector<SampleData>& samples );
|
||||||
|
@ -260,18 +260,17 @@ struct FlameGraphContext
|
|||||||
double nspx;
|
double nspx;
|
||||||
};
|
};
|
||||||
|
|
||||||
void View::DrawFlameGraphLevel( const std::vector<FlameGraphItem>& data, FlameGraphContext& ctx, uint64_t ts, int depth, bool samples )
|
void View::DrawFlameGraphLevel( const std::vector<FlameGraphItem>& data, FlameGraphContext& ctx, int depth, bool samples )
|
||||||
{
|
{
|
||||||
for( auto& v : data )
|
for( auto& v : data )
|
||||||
{
|
{
|
||||||
DrawFlameGraphItem( v, ctx, ts, depth, samples );
|
DrawFlameGraphItem( v, ctx, depth, samples );
|
||||||
ts += v.time;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ctx, uint64_t ts, int depth, bool samples )
|
void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ctx, int depth, bool samples )
|
||||||
{
|
{
|
||||||
const auto x0 = ctx.dpos.x + ts * ctx.pxns;
|
const auto x0 = ctx.dpos.x + item.begin * ctx.pxns;
|
||||||
const auto x1 = x0 + item.time * ctx.pxns;
|
const auto x1 = x0 + item.time * ctx.pxns;
|
||||||
const auto y0 = ctx.dpos.y + depth * ctx.ostep;
|
const auto y0 = ctx.dpos.y + depth * ctx.ostep;
|
||||||
const auto y1 = y0 + ctx.ty;
|
const auto y1 = y0 + ctx.ty;
|
||||||
@ -457,7 +456,7 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawFlameGraphLevel( item.children, ctx, ts, depth+1, samples );
|
DrawFlameGraphLevel( item.children, ctx, depth+1, samples );
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::DrawFlameGraphHeader( uint64_t timespan )
|
void View::DrawFlameGraphHeader( uint64_t timespan )
|
||||||
@ -740,7 +739,7 @@ void View::DrawFlameGraph()
|
|||||||
ctx.nspx = 1.0 / ctx.pxns;
|
ctx.nspx = 1.0 / ctx.pxns;
|
||||||
|
|
||||||
ImGui::ItemSize( region );
|
ImGui::ItemSize( region );
|
||||||
DrawFlameGraphLevel( m_flameGraphData, ctx, 0, 0, m_flameMode == 1 );
|
DrawFlameGraphLevel( m_flameGraphData, ctx, 0, m_flameMode == 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user