Struct webrender::clip::ClipTreeBuilder
source · pub struct ClipTreeBuilder {
clip_map: FastHashMap<ClipId, Handle<ClipIntern>>,
clip_chains: Vec<ClipChain>,
clip_chain_map: FastHashMap<ClipChainId, usize>,
clip_stack: Vec<ClipStackEntry>,
tree: ClipTree,
clip_handles_buffer: Vec<Handle<ClipIntern>>,
}
Expand description
Used by the scene builder to build the clip-tree that is part of the built scene.
Fields§
§clip_map: FastHashMap<ClipId, Handle<ClipIntern>>
Clips defined by the display list
clip_chains: Vec<ClipChain>
Clip-chains defined by the display list
clip_chain_map: FastHashMap<ClipChainId, usize>
§clip_stack: Vec<ClipStackEntry>
List of clips pushed/popped by grouping items, such as stacking contexts and iframes
tree: ClipTree
The tree we are building
clip_handles_buffer: Vec<Handle<ClipIntern>>
A temporary buffer stored here to avoid constant heap allocs/frees
Implementations§
source§impl ClipTreeBuilder
impl ClipTreeBuilder
pub fn new() -> Self
pub fn begin(&mut self)
pub fn recycle_tree(&mut self, tree: ClipTree)
sourcepub fn define_rect_clip(&mut self, id: ClipId, handle: Handle<ClipIntern>)
pub fn define_rect_clip(&mut self, id: ClipId, handle: Handle<ClipIntern>)
Define a new rect clip
sourcepub fn define_rounded_rect_clip(
&mut self,
id: ClipId,
handle: Handle<ClipIntern>,
)
pub fn define_rounded_rect_clip( &mut self, id: ClipId, handle: Handle<ClipIntern>, )
Define a new rounded rect clip
sourcepub fn define_image_mask_clip(&mut self, id: ClipId, handle: Handle<ClipIntern>)
pub fn define_image_mask_clip(&mut self, id: ClipId, handle: Handle<ClipIntern>)
Define a image mask clip
sourcepub fn define_clip_chain<I: Iterator<Item = ClipId>>(
&mut self,
id: ClipChainId,
parent: Option<ClipChainId>,
clips: I,
)
pub fn define_clip_chain<I: Iterator<Item = ClipId>>( &mut self, id: ClipChainId, parent: Option<ClipChainId>, clips: I, )
Define a clip-chain
sourcepub fn push_clip_chain(
&mut self,
clip_chain_id: Option<ClipChainId>,
reset_seen: bool,
)
pub fn push_clip_chain( &mut self, clip_chain_id: Option<ClipChainId>, reset_seen: bool, )
Push a clip-chain that will be applied to any prims built prior to next pop
sourcepub fn push_clip_id(&mut self, clip_id: ClipId)
pub fn push_clip_id(&mut self, clip_id: ClipId)
Push a clip-id that will be applied to any prims built prior to next pop
sourcefn add_clips(
clip_chain_index: usize,
seen_clips: &mut HashSet<Handle<ClipIntern>, BuildHasherDefault<FxHasher>>,
output: &mut Vec<Handle<ClipIntern>>,
clip_chains: &[ClipChain],
)
fn add_clips( clip_chain_index: usize, seen_clips: &mut HashSet<Handle<ClipIntern>, BuildHasherDefault<FxHasher>>, output: &mut Vec<Handle<ClipIntern>>, clip_chains: &[ClipChain], )
Add clips from a given clip-chain to the set of clips for a primitive during clip-set building
sourcepub fn build_clip_set(&mut self, clip_chain_id: ClipChainId) -> ClipNodeId
pub fn build_clip_set(&mut self, clip_chain_id: ClipChainId) -> ClipNodeId
Main entry point to build a path in the clip-tree for a given primitive
sourcefn has_complex_clips_impl(
&self,
clip_chain_index: usize,
interners: &Interners,
) -> bool
fn has_complex_clips_impl( &self, clip_chain_index: usize, interners: &Interners, ) -> bool
Recursive impl to check if a clip-chain has complex (non-rectangular) clips
sourcepub fn clip_chain_has_complex_clips(
&self,
clip_chain_id: ClipChainId,
interners: &Interners,
) -> bool
pub fn clip_chain_has_complex_clips( &self, clip_chain_id: ClipChainId, interners: &Interners, ) -> bool
Check if a clip-chain has complex (non-rectangular) clips
sourcepub fn clip_node_has_complex_clips(
&self,
clip_node_id: ClipNodeId,
interners: &Interners,
) -> bool
pub fn clip_node_has_complex_clips( &self, clip_node_id: ClipNodeId, interners: &Interners, ) -> bool
Check if a clip-node has complex (non-rectangular) clips
sourcepub fn get_node(&self, id: ClipNodeId) -> &ClipTreeNode
pub fn get_node(&self, id: ClipNodeId) -> &ClipTreeNode
Get a clip node by id
sourcepub fn get_leaf(&self, id: ClipLeafId) -> &ClipTreeLeaf
pub fn get_leaf(&self, id: ClipLeafId) -> &ClipTreeLeaf
Get a clip leaf by id
sourcepub fn build_for_tile_cache(
&mut self,
clip_node_id: ClipNodeId,
extra_clips: &[ClipId],
) -> ClipLeafId
pub fn build_for_tile_cache( &mut self, clip_node_id: ClipNodeId, extra_clips: &[ClipId], ) -> ClipLeafId
Build a clip-leaf for a tile-cache
sourcepub fn build_for_picture(&mut self, clip_node_id: ClipNodeId) -> ClipLeafId
pub fn build_for_picture(&mut self, clip_node_id: ClipNodeId) -> ClipLeafId
Build a clip-leaf for a picture
sourcepub fn build_for_prim(
&mut self,
clip_node_id: ClipNodeId,
info: &LayoutPrimitiveInfo,
extra_clips: &[ClipItemKey],
interners: &mut Interners,
) -> ClipLeafId
pub fn build_for_prim( &mut self, clip_node_id: ClipNodeId, info: &LayoutPrimitiveInfo, extra_clips: &[ClipItemKey], interners: &mut Interners, ) -> ClipLeafId
Build a clip-leaf for a normal primitive
pub fn find_lowest_common_ancestor( &self, node1: ClipNodeId, node2: ClipNodeId, ) -> ClipNodeId
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClipTreeBuilder
impl RefUnwindSafe for ClipTreeBuilder
impl Send for ClipTreeBuilder
impl Sync for ClipTreeBuilder
impl Unpin for ClipTreeBuilder
impl UnwindSafe for ClipTreeBuilder
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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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