Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
motion_cost_render.hpp
Go to the documentation of this file.
1#pragma once
2
21
25
26namespace pulp::view::motion {
27
35) {
36 return [passes, dirty]() -> RenderCostSnapshot {
38 if (passes) {
39 s.render_pass_duration_ms =
40 static_cast<double>(passes->total_time_ms());
41 }
42 if (dirty) {
43 const auto& rects = dirty->dirty_rects();
44 double area = 0.0;
45 for (const auto& r : rects) {
46 area += static_cast<double>(r.area());
47 }
48 s.dirty_rect_area_px = area;
49 s.dirty_rect_count = static_cast<int>(rects.size());
50 }
51 return s;
52 };
53}
54
55} // namespace pulp::view::motion
Tracks rectangular regions that need repainting.
Definition dirty_tracker.hpp:13
const std::vector< Rect > & dirty_rects() const
Get the list of dirty rectangles (empty if full repaint).
Definition dirty_tracker.hpp:60
Frame-level render pass manager.
Definition render_pass.hpp:41
float total_time_ms() const
Total time for the last frame.
Definition render_pass.hpp:117
Motion cost attribution — correlates render-pass cost and dirty area with the motion traces that were...
Definition motion.hpp:26
std::function< RenderCostSnapshot()> CostProbe
Definition motion_cost.hpp:78
CostProbe make_render_cost_probe(const pulp::render::RenderPassManager *passes, const pulp::render::DirtyTracker *dirty)
Build a CostProbe that snapshots both subsystems each tick.
Definition motion_cost_render.hpp:32
@ s
Definition input_events.hpp:41
@ r
Definition input_events.hpp:41
Snapshot of render-layer cost for the current frame.
Definition motion_cost.hpp:72