pub struct GpuClipMask {
pub bounds: Rect,
pub layers: Vec<Vec<Vec<(f32, f32)>>>,
pub stencil_layers: Vec<Vec<GpuClipVertex>>,
}Expand description
Compiled polygonal/stencil clip mask for circular, rounded, or arbitrary CAD clip paths.
Fields§
§bounds: RectConservative axis-aligned bounding box of the intersected clip region.
layers: Vec<Vec<Vec<(f32, f32)>>>Active non-rectangular clip layers; each layer contains closed/open subpaths evaluated even-odd.
stencil_layers: Vec<Vec<GpuClipVertex>>Triangulated vertex triplets per clip layer (3 vertices per triangle) for GPU stencil passes.
Implementations§
Source§impl GpuClipMask
impl GpuClipMask
Sourcepub fn from_layers(bounds: Rect, layers: Vec<Vec<Vec<(f32, f32)>>>) -> Self
pub fn from_layers(bounds: Rect, layers: Vec<Vec<Vec<(f32, f32)>>>) -> Self
Constructs and triangulates a stencil clip mask from a stack of subpath layers.
Sourcepub fn contains_point(&self, x: f32, y: f32) -> bool
pub fn contains_point(&self, x: f32, y: f32) -> bool
Returns true if (x, y) passes the intersected AABB and all even-odd polygon layers.
Sourcepub fn rect_containment(&self, rect: Rect) -> ClipContainment
pub fn rect_containment(&self, rect: Rect) -> ClipContainment
Evaluates containment of rect against all clip layers in this mask.
Sourcepub fn total_stencil_vertices(&self) -> usize
pub fn total_stencil_vertices(&self) -> usize
Total number of stencil triangle vertices across all active clip layers.
Trait Implementations§
Source§impl Clone for GpuClipMask
impl Clone for GpuClipMask
Source§impl Debug for GpuClipMask
impl Debug for GpuClipMask
Source§impl PartialEq for GpuClipMask
impl PartialEq for GpuClipMask
impl StructuralPartialEq for GpuClipMask
Auto Trait Implementations§
impl Forget for GpuClipMask
impl Freeze for GpuClipMask
impl Move for GpuClipMask
impl RefUnwindSafe for GpuClipMask
impl Send for GpuClipMask
impl Sync for GpuClipMask
impl Unpin for GpuClipMask
impl UnsafeUnpin for GpuClipMask
impl UnwindSafe for GpuClipMask
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