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

source

pub fn new() -> Self

source

pub fn begin(&mut self)

source

pub fn recycle_tree(&mut self, tree: ClipTree)

source

pub fn define_rect_clip(&mut self, id: ClipId, handle: Handle<ClipIntern>)

Define a new rect clip

source

pub fn define_rounded_rect_clip( &mut self, id: ClipId, handle: Handle<ClipIntern>, )

Define a new rounded rect clip

source

pub fn define_image_mask_clip(&mut self, id: ClipId, handle: Handle<ClipIntern>)

Define a image mask clip

source

pub fn define_clip_chain<I: Iterator<Item = ClipId>>( &mut self, id: ClipChainId, parent: Option<ClipChainId>, clips: I, )

Define a clip-chain

source

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

source

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

source

pub fn pop_clip(&mut self)

Pop a clip off the clip_stack, when exiting a grouping item

source

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

source

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

source

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

source

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

source

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

source

pub fn finalize(&mut self) -> ClipTree

Finalize building and return the clip-tree

source

pub fn get_node(&self, id: ClipNodeId) -> &ClipTreeNode

Get a clip node by id

source

pub fn get_leaf(&self, id: ClipLeafId) -> &ClipTreeLeaf

Get a clip leaf by id

source

pub fn build_for_tile_cache( &mut self, clip_node_id: ClipNodeId, extra_clips: &[ClipId], ) -> ClipLeafId

Build a clip-leaf for a tile-cache

source

pub fn build_for_picture(&mut self, clip_node_id: ClipNodeId) -> ClipLeafId

Build a clip-leaf for a picture

source

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

source

pub fn find_lowest_common_ancestor( &self, node1: ClipNodeId, node2: ClipNodeId, ) -> ClipNodeId

Trait Implementations§

source§

impl Serialize for ClipTreeBuilder

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.