pub enum Damage {
None,
Regions(Vec<Rect>),
Full,
}Expand description
What changed between two frames, in logical pixels.
Variants§
None
Nothing changed; the previous frame is still valid (skip present).
Regions(Vec<Rect>)
Only these rectangles changed.
Full
Everything must be repainted (first frame, resize, or an overlay change the tree diff can’t localize).
Implementations§
Source§impl Damage
impl Damage
Sourcepub fn bounding(&self) -> Option<Rect>
pub fn bounding(&self) -> Option<Rect>
The single rectangle covering all damage, or None for Damage::None.
Damage::Full has no finite bound, so it also returns None.
Sourcepub fn to_physical(&self, scale: ScaleFactor, bounds: Rect) -> Vec<Rect>
pub fn to_physical(&self, scale: ScaleFactor, bounds: Rect) -> Vec<Rect>
Convert to physical-pixel rectangles for Surface::present, clamped to
a bounds (the surface size) and rounded outward to whole pixels.
Damage::None and Damage::Full both yield an empty list — which the
Surface contract reads as “assume everything changed”. Callers that
want to skip a no-op present should check Damage::is_empty first.
Trait Implementations§
impl StructuralPartialEq for Damage
Auto Trait Implementations§
impl Freeze for Damage
impl RefUnwindSafe for Damage
impl Send for Damage
impl Sync for Damage
impl Unpin for Damage
impl UnsafeUnpin for Damage
impl UnwindSafe for Damage
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