pub struct DamageTracker { /* private fields */ }Implementations§
Source§impl DamageTracker
impl DamageTracker
pub fn new() -> DamageTracker
Sourcepub fn mark_full(&mut self)
pub fn mark_full(&mut self)
Whole viewport needs repainting (resize, DPI, theme, root mount/unmount).
Sourcepub fn mark_layout(&mut self)
pub fn mark_layout(&mut self)
The change affects measurement/layout (not just pixels).
Sourcepub fn request_frame(&mut self)
pub fn request_frame(&mut self)
Called by PaintCtx::request_frame() — “paint me in the next frame”.
Sourcepub fn take_motion(&mut self) -> bool
pub fn take_motion(&mut self) -> bool
Consumes the request from the previous frame. Called once per frame, BEFORE paint.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
No pixels or animation work are pending.
Bookkeeping-only flags (HIT_TEST, DATA) do not count as a frame.
pub fn needs_frame(&self) -> bool
pub fn needs_layout(&self) -> bool
pub fn needs_paint(&self) -> bool
pub fn flags(&self) -> Dirty
Sourcepub fn paint_region(&self) -> Option<Rect>
pub fn paint_region(&self) -> Option<Rect>
Some(rect) = repaint only this area. None = full repaint.
Layout changes can move or remove children, so they always require a full repaint; a screen-space rect alone cannot describe that damage. The 2 px margin covers anti-aliasing; the renderer adds more headroom for shadows before using the region as a scissor.
This is the bounding box of paint_regions; use
the individual regions when the backend supports multiple scissors.
Sourcepub fn paint_regions(&self) -> Option<Vec<Rect>>
pub fn paint_regions(&self) -> Option<Vec<Rect>>
Some(regions) = repaint only these disjoint areas. None = full
repaint.
Each region is inflated by 2 px for anti-aliasing. Regions that overlap are merged while marks accumulate; if more than the region cap remain, they collapse into one bounding box.
Sourcepub fn after_paint(&mut self)
pub fn after_paint(&mut self)
Called after paint — resets the current frame state.
Does NOT touch motion_pending, because paint may have queued a new request.
Sourcepub fn record_skipped(&mut self)
pub fn record_skipped(&mut self)
Called when a frame is skipped.
Also clears bookkeeping markers (HIT_TEST, DATA) that require no
pixels so they do not keep needs_frame() alive forever.
pub fn frames_painted(&self) -> u64
pub fn frames_skipped(&self) -> u64
Trait Implementations§
Source§impl Clone for DamageTracker
impl Clone for DamageTracker
Source§fn clone(&self) -> DamageTracker
fn clone(&self) -> DamageTracker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more