pub struct DamageTracker {
pub dirty_rects: Vec<Rect>,
}Expand description
Tracks damaged (dirty) screen regions across frames to minimize redraw overhead.
Fields§
§dirty_rects: Vec<Rect>Implementations§
Source§impl DamageTracker
impl DamageTracker
pub fn new() -> Self
pub fn add_damage(&mut self, rect: Rect)
Sourcepub fn bounding_damage(&self) -> Option<Rect>
pub fn bounding_damage(&self) -> Option<Rect>
Computes the minimal bounding rectangle covering all dirty regions.
Sourcepub fn cluster_damage_rects(&self) -> Vec<Rect>
pub fn cluster_damage_rects(&self) -> Vec<Rect>
Hierarchically clusters dirty rects into isolated non-overlapping bounding regions.
Prevents disjoint localized damage (e.g., caret blink at top-left, button ripple at bottom-right) from inflating into a catastrophic full-canvas bounding box.
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for DamageTracker
impl Clone for DamageTracker
Source§impl Debug for DamageTracker
impl Debug for DamageTracker
Source§impl Default for DamageTracker
impl Default for DamageTracker
Source§impl PartialEq for DamageTracker
impl PartialEq for DamageTracker
impl StructuralPartialEq for DamageTracker
Auto Trait Implementations§
impl Forget for DamageTracker
impl Freeze for DamageTracker
impl Move for DamageTracker
impl RefUnwindSafe for DamageTracker
impl Send for DamageTracker
impl Sync for DamageTracker
impl Unpin for DamageTracker
impl UnsafeUnpin for DamageTracker
impl UnwindSafe for DamageTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more