Accumulated repaint damage for one frame, in root/window coordinates. More...
#include <pending_damage.hpp>
Classes | |
| class | Snapshot |
| One frame's damage, taken atomically out of a PendingDamage. More... | |
Public Member Functions | |
| void | mark_full () |
| Whole-surface repaint. Any structural change uses this. | |
| void | mark (const Rect &root_rect) |
| Union a bounded region (root coords) into this frame's damage. | |
| bool | is_full () const |
| bool | has_bounds () const |
| Rect | bounds () const |
| void | clear () |
| Called by the host once it has painted and submitted the frame. | |
| Snapshot | take () |
| Read this frame's damage AND clear it, in one step. | |
| void | restore (const Snapshot &s) |
| Put a taken snapshot back after a frame failed to reach its output. | |
Accumulated repaint damage for one frame, in root/window coordinates.
Extracted so the WINDOW host and the PLUG-IN host can share one definition of "what changed this frame". Before this existed the state lived only on WindowHost, so View::request_repaint(Rect) had nowhere to put a bounded rect on the plug-in path and discarded it — which meant partial repaint was unreachable for every plug-in editor on every platform, however the host was wired.
The invariants are what make bounded damage safe to ignore or honour:
A frame CONSUMES damage with take(), which reads and clears in one step. Reading the three accessors and then calling clear() separately is how a host ends up clearing a different logical state than the one it painted — most importantly when the frame never reached the screen. A frame that failed puts its snapshot back with restore(), so the damage survives the retry.
|
inline |
|
inline |
Called by the host once it has painted and submitted the frame.
|
inline |
|
inline |
|
inline |
Union a bounded region (root coords) into this frame's damage.
|
inline |
Whole-surface repaint. Any structural change uses this.
|
inline |
Put a taken snapshot back after a frame failed to reach its output.
Unions rather than overwrites, so damage marked while the failed frame was in flight is preserved too, and the sticky-full rule still holds: restoring a full snapshot leaves the repaint full regardless of what arrived in the meantime.
|
inline |
Read this frame's damage AND clear it, in one step.
The host paints against the returned snapshot. If the frame reaches its intended output, the snapshot is simply dropped. If it does not, the host calls restore() so the next attempt repaints at least as much.