pub struct CullCtx { /* private fields */ }Expand description
Culling configuration for Runtime::paint_region.
ENABLED is the default for paint, paint_if_dirty, and the platform.
DISABLED forces a full CPU pass; RenderList still clips fully
off-screen items at push time, so the visible output is unchanged.
Implementations§
Source§impl CullCtx
impl CullCtx
pub const fn new() -> Self
pub const fn disabled() -> Self
pub fn with_margin(self, margin: f32) -> Self
pub fn is_enabled(self) -> bool
pub fn margin(self) -> f32
Sourcepub fn intersects(self, rect: Rect, clip: Option<Rect>) -> bool
pub fn intersects(self, rect: Rect, clip: Option<Rect>) -> bool
Does rect (expanded by the margin) intersect clip?
- Culling disabled →
true. clip = None(no clip on the path) →true.- Empty
clip→false(nothing is visible).
Sourcepub fn fully_clipped(
self,
rect: Rect,
clip: Option<Rect>,
clip_self: bool,
) -> bool
pub fn fully_clipped( self, rect: Rect, clip: Option<Rect>, clip_self: bool, ) -> bool
Is the whole subtree invisible?
Unlike !intersects, this also requires the element to clip itself
(clip_self), so its children are clipped to the parent rect too.
Without clip_self, children may overflow (e.g. overflow: Visible)
and must not be skipped.
Trait Implementations§
impl Copy for CullCtx
impl StructuralPartialEq for CullCtx
Auto Trait Implementations§
impl Freeze for CullCtx
impl RefUnwindSafe for CullCtx
impl Send for CullCtx
impl Sync for CullCtx
impl Unpin for CullCtx
impl UnsafeUnpin for CullCtx
impl UnwindSafe for CullCtx
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