Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
repaint_damage.hpp
Go to the documentation of this file.
1#pragma once
2
4
5// FU-2 / WI-17 — the partial-repaint damage model.
6//
7// `compute_effective_damage` is the pure, side-effect-free heart of partial
8// repaint: given the requested dirty rect (in ROOT logical coordinates, exactly
9// what `View::request_repaint(Rect)` produces) it returns either a bounded clip
10// rect that is PIXEL-IDENTICAL to a full repaint, or a "repaint everything"
11// escalation when any view in the tree would sample pixels the clip cannot
12// preserve.
13//
14// It has no GPU, canvas, or platform dependency and is unit-tested directly
15// (test/test_partial_repaint_equivalence.cpp). Three hosts consume it, all
16// gated behind PULP_PARTIAL_REPAINT=1: the macOS GPU WINDOW host, and the
17// Windows and Linux PLUG-IN hosts via `compute_frame_clip()` in
18// plugin_frame_renderer.hpp.
19//
20// One thing that decision does NOT do, and callers must: this function works in
21// ROOT logical coordinates, because that is the space damage is produced in. A
22// host that paints through a design-viewport letterbox installs its clip in
23// SURFACE space, BEFORE that transform is applied — so the returned rect has to
24// be mapped through the same translate+scale and re-snapped to whole surface
25// pixels before use. `compute_frame_clip()` does that; a host that skips it
26// clips the wrong region rather than failing visibly.
27
28namespace pulp::view {
29
30class View;
31
39 bool full = true;
41};
42
73 const Rect& requested_root_rect,
74 float device_scale = 1.0f);
75
76} // namespace pulp::view
Definition view.hpp:73
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
DamageDecision compute_effective_damage(const View &root, const Rect &requested_root_rect, float device_scale=1.0f)
Decide whether requested_root_rect can be repainted as a bounded clip (pixel-identical to a full repa...
The result of the damage decision.
Definition repaint_damage.hpp:38
bool full
Definition repaint_damage.hpp:39
Rect bounds
Definition repaint_damage.hpp:40
Axis-aligned rectangle in continuous (float) coordinates.
Definition geometry.hpp:52