pub struct DirtyRectSet { /* private fields */ }Expand description
Bounded zero-allocation multi-rect dirty set tracking up to 16 disjoint physical damage rectangles.
Implementations§
Source§impl DirtyRectSet
Surgical multi-rect dirty tracking, union-waste strategy selection, and DamageRegion interop for DirtyRectSet.
impl DirtyRectSet
Surgical multi-rect dirty tracking, union-waste strategy selection, and DamageRegion interop for DirtyRectSet.
Sourcepub const fn full() -> Self
pub const fn full() -> Self
Creates a DirtyRectSet representing full-viewport damage.
§Returns
Self- Full-frame dirty rect set.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears all rectangles and resets full-frame and overflow flags.
§Arguments
&Self- Mutable dirty rect set.
Sourcepub fn from_damage_region(damage: DamageRegion, width: u32, height: u32) -> Self
pub fn from_damage_region(damage: DamageRegion, width: u32, height: u32) -> Self
Sourcepub fn add_rect_clamped(&mut self, rect: Rect, width: u32, height: u32)
pub fn add_rect_clamped(&mut self, rect: Rect, width: u32, height: u32)
Adds a physical damage rectangle clipped to (width, height), merging only overlapping or touching rectangles so distant rects remain disjoint.
§Arguments
&Self- Mutable dirty rect set.Rect- Incoming damage rectangle in physical pixels.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.
Sourcepub fn add_rect(&mut self, rect: Rect)
pub fn add_rect(&mut self, rect: Rect)
Adds a physical damage rectangle, coalescing only overlapping or touching rectangles and keeping distant rectangles separate up to DIRTY_RECT_SET_CAPACITY.
§Arguments
&Self- Mutable dirty rect set.Rect- Incoming non-empty damage rectangle.
Sourcepub fn merged_bbox(&self) -> Option<Rect>
pub fn merged_bbox(&self) -> Option<Rect>
Sourcepub fn total_dirty_area(&self) -> f32
pub fn total_dirty_area(&self) -> f32
Sourcepub fn union_waste_ratio(&self) -> f32
pub fn union_waste_ratio(&self) -> f32
Sourcepub fn select_strategy(
&self,
viewport_w: u32,
viewport_h: u32,
full_ratio_threshold: f32,
merge_waste_ratio: f32,
) -> DirtyRectStrategy
pub fn select_strategy( &self, viewport_w: u32, viewport_h: u32, full_ratio_threshold: f32, merge_waste_ratio: f32, ) -> DirtyRectStrategy
Selects the optimal submission strategy (Empty, MultiRect, MergedBbox, or FullFrame) using viewport coverage and union-area waste ratio.
§Arguments
&Self- Dirty rect set reference.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.f32- Area coverage threshold in(0.1..=1.0]promoting toFullFrame.f32- Union-area waste ratio threshold above which disjoint rects stayMultiRect.
§Returns
DirtyRectStrategy- Selected dirty-region execution strategy.
Sourcepub fn select_default_strategy(
&self,
viewport_w: u32,
viewport_h: u32,
) -> DirtyRectStrategy
pub fn select_default_strategy( &self, viewport_w: u32, viewport_h: u32, ) -> DirtyRectStrategy
Selects the optimal submission strategy using default thresholds (0.70 full-frame coverage, 0.35 merge waste ratio).
§Arguments
&Self- Dirty rect set reference.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.
§Returns
DirtyRectStrategy- Selected dirty-region execution strategy.
Sourcepub fn intersects_rect(&self, region: Rect) -> bool
pub fn intersects_rect(&self, region: Rect) -> bool
Sourcepub fn to_damage_region(
&self,
viewport_w: u32,
viewport_h: u32,
strategy: DirtyRectStrategy,
) -> DamageRegion
pub fn to_damage_region( &self, viewport_w: u32, viewport_h: u32, strategy: DirtyRectStrategy, ) -> DamageRegion
Converts this DirtyRectSet into a DamageRegion honoring strategy without collapsing disjoint MultiRect regions into a single giant bbox.
§Arguments
&Self- Dirty rect set reference.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.DirtyRectStrategy- Chosen dirty-region submission strategy.
§Returns
DamageRegion- Resulting renderer/platform damage region.
Sourcepub fn apply_effect_dependency_damage(
&mut self,
regions: &[PortalBackdropRegion],
viewport_w: u32,
viewport_h: u32,
scale: f32,
full_ratio_threshold: f32,
) -> EffectDamageReport
pub fn apply_effect_dependency_damage( &mut self, regions: &[PortalBackdropRegion], viewport_w: u32, viewport_h: u32, scale: f32, full_ratio_threshold: f32, ) -> EffectDamageReport
Evaluates surgical effect-dependency damage across visible portals and backdrop-blur regions, expanding ONLY intersecting or dirty regions by ceil(2.0 * blur_radius).
§Arguments
&Self- Mutable dirty rect set in physical pixels.&[PortalBackdropRegion]- Visible portal and backdrop-blur descriptors in logical coordinates.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.f32- Active display scale factor.f32- Area coverage threshold in(0.1..=1.0]promoting toFullFrame.
§Returns
EffectDamageReport- Counts of expanded/skipped regions and whether full-frame escalation occurred.
Sourcepub fn upload_strategy(
&self,
viewport_w: u32,
viewport_h: u32,
) -> UploadStrategy
pub fn upload_strategy( &self, viewport_w: u32, viewport_h: u32, ) -> UploadStrategy
Bridges this dirty-rect set’s selected DirtyRectStrategy directly into the unified UploadStrategy.
§Arguments
&Self- Dirty rect set reference.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.
§Returns
UploadStrategy- Unified upload strategy (None,MultiRect,MergedBbox, orFullFrame).
Sourcepub fn mobile_upload_strategy(
&self,
viewport_w: u32,
viewport_h: u32,
) -> MobileUploadStrategy
pub fn mobile_upload_strategy( &self, viewport_w: u32, viewport_h: u32, ) -> MobileUploadStrategy
Bridges this dirty-rect set’s selected DirtyRectStrategy directly into MobileUploadStrategy.
§Arguments
&Self- Dirty rect set reference.u32- Physical viewport width in pixels.u32- Physical viewport height in pixels.
§Returns
MobileUploadStrategy- Mobile upload strategy (None,MultiRect,MergedBbox, orFullFrame).
Source§impl DirtyRectSet
impl DirtyRectSet
pub fn get_len(&self) -> usize
pub fn get_full_frame(&self) -> bool
pub fn get_mut_full_frame(&mut self) -> &mut bool
pub fn set_full_frame(&mut self, val: bool) -> &mut Self
pub fn get_overflowed(&self) -> bool
pub fn get_mut_overflowed(&mut self) -> &mut bool
pub fn set_overflowed(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for DirtyRectSet
impl Clone for DirtyRectSet
impl Copy for DirtyRectSet
Source§impl Debug for DirtyRectSet
impl Debug for DirtyRectSet
Source§impl Default for DirtyRectSet
Default empty DirtyRectSet.
impl Default for DirtyRectSet
Default empty DirtyRectSet.