pub struct DamageRegion { /* private fields */ }Expand description
Dirty bounding region tracking damaged screen areas between frames using zero-allocation inline stack storage.
Implementations§
Source§impl DamageRegion
Damage accumulation helpers for DamageRegion.
impl DamageRegion
Damage accumulation helpers for DamageRegion.
Sourcepub fn add_rect(&mut self, rect: Rect)
pub fn add_rect(&mut self, rect: Rect)
Expands the damaged region to include rect, normalizing disjoint regions inline on the stack.
§Arguments
&Self- Mutable damage region.Rect- Newly damaged rectangle.
Sourcepub fn bounds_rect(&self) -> Option<Rect>
pub fn bounds_rect(&self) -> Option<Rect>
Sourcepub fn optimize_for_viewport(
&mut self,
width: u32,
height: u32,
full_fallback_ratio: f32,
) -> bool
pub fn optimize_for_viewport( &mut self, width: u32, height: u32, full_fallback_ratio: f32, ) -> bool
Optimizes multi-rect damage by merging low-waste adjacent pairs and promoting to full-viewport damage when covered area exceeds full_fallback_ratio.
§Arguments
&Self- Mutable damage region.u32- Surface physical width in pixels.u32- Surface physical height in pixels.f32- Area coverage threshold in(0.1..=1.0]above which full-frame fallback triggers.
§Returns
bool-trueif the damage region was promoted tofull_damage.
Sourcepub fn active_rect_count(&self) -> usize
pub fn active_rect_count(&self) -> usize
Source§impl DamageRegion
impl DamageRegion
pub fn get_full_damage(&self) -> bool
pub fn get_mut_full_damage(&mut self) -> &mut bool
pub fn set_full_damage(&mut self, val: bool) -> &mut Self
pub fn get_mut_rect(&mut self) -> &mut Option<Rect>
pub fn set_rect(&mut self, val: Option<Rect>) -> &mut Self
Trait Implementations§
Source§impl Clone for DamageRegion
impl Clone for DamageRegion
impl Copy for DamageRegion
Source§impl Debug for DamageRegion
impl Debug for DamageRegion
Source§impl Default for DamageRegion
impl Default for DamageRegion
Source§impl PartialEq for DamageRegion
impl PartialEq for DamageRegion
impl StructuralPartialEq for DamageRegion
Auto Trait Implementations§
impl Forget for DamageRegion
impl Freeze for DamageRegion
impl Move for DamageRegion
impl RefUnwindSafe for DamageRegion
impl Send for DamageRegion
impl Sync for DamageRegion
impl Unpin for DamageRegion
impl UnsafeUnpin for DamageRegion
impl UnwindSafe for DamageRegion
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