pub struct ClipTree {
nodes: Vec<ClipTreeNode>,
leaves: Vec<ClipTreeLeaf>,
clip_root_stack: Vec<ClipNodeId>,
}
Expand description
A clip-tree built during scene building and used during frame-building to apply clips to primitives.
Fields§
§nodes: Vec<ClipTreeNode>
§leaves: Vec<ClipTreeLeaf>
§clip_root_stack: Vec<ClipNodeId>
Implementations§
source§impl ClipTree
impl ClipTree
pub fn new() -> Self
sourcefn add_impl(
id: ClipNodeId,
clips: &[Handle<ClipIntern>],
nodes: &mut Vec<ClipTreeNode>
) -> ClipNodeId
fn add_impl( id: ClipNodeId, clips: &[Handle<ClipIntern>], nodes: &mut Vec<ClipTreeNode> ) -> ClipNodeId
Add a set of clips to the provided tree node id, reusing existing nodes in the tree where possible
sourcepub fn add(
&mut self,
root: ClipNodeId,
clips: &[Handle<ClipIntern>]
) -> ClipNodeId
pub fn add( &mut self, root: ClipNodeId, clips: &[Handle<ClipIntern>] ) -> ClipNodeId
Add a set of clips to the provided tree node id, reusing existing nodes in the tree where possible
sourcepub fn current_clip_root(&self) -> ClipNodeId
pub fn current_clip_root(&self) -> ClipNodeId
Get the current clip root (the node in the clip-tree where clips can be ignored when building the clip-chain instance for a primitive)
sourcepub fn push_clip_root_leaf(&mut self, clip_leaf_id: ClipLeafId)
pub fn push_clip_root_leaf(&mut self, clip_leaf_id: ClipLeafId)
Push a clip root (e.g. when a surface is encountered) that prevents clips from this node and above being applied to primitives within the root.
sourcepub fn push_clip_root_node(&mut self, clip_node_id: ClipNodeId)
pub fn push_clip_root_node(&mut self, clip_node_id: ClipNodeId)
Push a clip root (e.g. when a surface is encountered) that prevents clips from this node and above being applied to primitives within the root.
sourcepub fn pop_clip_root(&mut self)
pub fn pop_clip_root(&mut self)
Pop a clip root, when exiting a surface.
sourcepub fn get_node(&self, id: ClipNodeId) -> &ClipTreeNode
pub fn get_node(&self, id: ClipNodeId) -> &ClipTreeNode
Retrieve a clip tree node by id
sourcepub fn get_leaf(&self, id: ClipLeafId) -> &ClipTreeLeaf
pub fn get_leaf(&self, id: ClipLeafId) -> &ClipTreeLeaf
Retrieve a clip tree leaf by id
sourcepub fn find_lowest_common_ancestor(
&self,
node1: ClipNodeId,
node2: ClipNodeId
) -> ClipNodeId
pub fn find_lowest_common_ancestor( &self, node1: ClipNodeId, node2: ClipNodeId ) -> ClipNodeId
Find the lowest common ancestor of two clip tree nodes. This is useful to identify shared clips between primitives attached to different clip-leaves.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ClipTree
impl Send for ClipTree
impl Sync for ClipTree
impl Unpin for ClipTree
impl UnwindSafe for ClipTree
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more