Struct webrender::tile_cache::TileCacheBuilder
source · pub struct TileCacheBuilder {
primary_slices: Vec<PrimarySlice>,
prev_scroll_root_cache: (SpatialNodeIndex, SpatialNodeIndex),
root_spatial_node_index: SpatialNodeIndex,
debug_flags: DebugFlags,
}
Expand description
Used during scene building to construct the list of pending tile caches.
Fields§
§primary_slices: Vec<PrimarySlice>
List of tile caches that have been created so far (last in the list is currently active).
prev_scroll_root_cache: (SpatialNodeIndex, SpatialNodeIndex)
Cache the previous scroll root search for a spatial node, since they are often the same.
root_spatial_node_index: SpatialNodeIndex
Handle to the root reference frame
debug_flags: DebugFlags
Debug flags to provide to our TileCacheInstances.
Implementations§
source§impl TileCacheBuilder
impl TileCacheBuilder
sourcepub fn new(
root_spatial_node_index: SpatialNodeIndex,
background_color: Option<ColorF>,
debug_flags: DebugFlags,
) -> Self
pub fn new( root_spatial_node_index: SpatialNodeIndex, background_color: Option<ColorF>, debug_flags: DebugFlags, ) -> Self
Construct a new tile cache builder.
pub fn make_current_slice_atomic(&mut self)
sourcepub fn is_current_slice_empty(&self) -> bool
pub fn is_current_slice_empty(&self) -> bool
Returns true if the current slice has no primitives added yet
sourcepub fn add_tile_cache_barrier(
&mut self,
slice_flags: SliceFlags,
iframe_clip: Option<ClipId>,
)
pub fn add_tile_cache_barrier( &mut self, slice_flags: SliceFlags, iframe_clip: Option<ClipId>, )
Set a barrier that forces a new tile cache next time a prim is added.
sourcefn build_tile_cache(
&mut self,
prim_list: PrimitiveList,
spatial_tree: &SceneSpatialTree,
prim_instances: &[PrimitiveInstance],
clip_tree_builder: &ClipTreeBuilder,
) -> Option<SliceDescriptor>
fn build_tile_cache( &mut self, prim_list: PrimitiveList, spatial_tree: &SceneSpatialTree, prim_instances: &[PrimitiveInstance], clip_tree_builder: &ClipTreeBuilder, ) -> Option<SliceDescriptor>
Create a new tile cache for an existing prim_list
sourcepub fn add_prim(
&mut self,
prim_instance: PrimitiveInstance,
prim_rect: LayoutRect,
spatial_node_index: SpatialNodeIndex,
prim_flags: PrimitiveFlags,
spatial_tree: &SceneSpatialTree,
interners: &Interners,
quality_settings: &QualitySettings,
prim_instances: &mut Vec<PrimitiveInstance>,
clip_tree_builder: &ClipTreeBuilder,
)
pub fn add_prim( &mut self, prim_instance: PrimitiveInstance, prim_rect: LayoutRect, spatial_node_index: SpatialNodeIndex, prim_flags: PrimitiveFlags, spatial_tree: &SceneSpatialTree, interners: &Interners, quality_settings: &QualitySettings, prim_instances: &mut Vec<PrimitiveInstance>, clip_tree_builder: &ClipTreeBuilder, )
Add a primitive, either to the current tile cache, or a new one, depending on various conditions.
sourcepub fn build(
self,
config: &FrameBuilderConfig,
prim_store: &mut PrimitiveStore,
spatial_tree: &SceneSpatialTree,
prim_instances: &[PrimitiveInstance],
clip_tree_builder: &mut ClipTreeBuilder,
) -> (TileCacheConfig, Vec<PictureIndex>)
pub fn build( self, config: &FrameBuilderConfig, prim_store: &mut PrimitiveStore, spatial_tree: &SceneSpatialTree, prim_instances: &[PrimitiveInstance], clip_tree_builder: &mut ClipTreeBuilder, ) -> (TileCacheConfig, Vec<PictureIndex>)
Consume this object and build the list of tile cache primitives
Auto Trait Implementations§
impl Freeze for TileCacheBuilder
impl RefUnwindSafe for TileCacheBuilder
impl Send for TileCacheBuilder
impl Sync for TileCacheBuilder
impl Unpin for TileCacheBuilder
impl UnwindSafe for TileCacheBuilder
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
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>
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 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>
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