Struct webrender::picture::PicturePrimitive
source · pub struct PicturePrimitive {Show 15 fields
pub prim_list: PrimitiveList,
pub is_backface_visible: bool,
pub primary_render_task_id: Option<RenderTaskId>,
pub secondary_render_task_id: Option<RenderTaskId>,
pub composite_mode: Option<PictureCompositeMode>,
pub raster_config: Option<RasterConfig>,
pub context_3d: Picture3DContext<OrderedPictureChild>,
pub extra_gpu_data_handles: SmallVec<[GpuCacheHandle; 1]>,
pub spatial_node_index: SpatialNodeIndex,
pub prev_local_rect: LayoutRect,
pub segments_are_valid: bool,
pub is_opaque: bool,
pub raster_space: RasterSpace,
pub flags: PictureFlags,
pub clip_root: Option<ClipNodeId>,
}
Fields§
§prim_list: PrimitiveList
List of primitives, and associated info for this picture.
is_backface_visible: bool
If false and transform ends up showing the back of the picture, it will be considered invisible.
primary_render_task_id: Option<RenderTaskId>
All render tasks have 0-2 input tasks.
secondary_render_task_id: Option<RenderTaskId>
If a mix-blend-mode, contains the render task for the readback of the framebuffer that we use to sample from in the mix-blend-mode shader. For drop-shadow filter, this will store the original picture task which would be rendered on screen after blur pass. This is also used by SVGFEBlend, SVGFEComposite and SVGFEDisplacementMap filters.
composite_mode: Option<PictureCompositeMode>
How this picture should be composited. If None, don’t composite - just draw directly on parent surface.
raster_config: Option<RasterConfig>
§context_3d: Picture3DContext<OrderedPictureChild>
§extra_gpu_data_handles: SmallVec<[GpuCacheHandle; 1]>
§spatial_node_index: SpatialNodeIndex
The spatial node index of this picture when it is composited into the parent picture.
prev_local_rect: LayoutRect
Store the state of the previous local rect for this picture. We need this in order to know when to invalidate segments / drop-shadow gpu cache handles.
segments_are_valid: bool
If false, this picture needs to (re)build segments if it supports segment rendering. This can occur if the local rect of the picture changes due to transform animation and/or scrolling.
is_opaque: bool
Set to true if we know for sure the picture is fully opaque.
raster_space: RasterSpace
Requested raster space for this picture
flags: PictureFlags
Flags for this picture primitive
clip_root: Option<ClipNodeId>
The lowest common ancestor clip of all of the primitives in this picture, to be ignored when clipping those primitives and applied later when compositing the picture.
Implementations§
source§impl PicturePrimitive
impl PicturePrimitive
pub fn print<T: PrintTreePrinter>( &self, pictures: &[Self], self_index: PictureIndex, pt: &mut T, )
fn resolve_scene_properties(&mut self, properties: &SceneProperties)
pub fn is_visible(&self, spatial_tree: &SpatialTree) -> bool
pub fn new_image( composite_mode: Option<PictureCompositeMode>, context_3d: Picture3DContext<OrderedPictureChild>, prim_flags: PrimitiveFlags, prim_list: PrimitiveList, spatial_node_index: SpatialNodeIndex, raster_space: RasterSpace, flags: PictureFlags, ) -> Self
pub fn take_context( &mut self, pic_index: PictureIndex, parent_surface_index: Option<SurfaceIndex>, parent_subpixel_mode: SubpixelMode, frame_state: &mut FrameBuildingState<'_>, frame_context: &FrameBuildingContext<'_>, data_stores: &mut DataStores, scratch: &mut PrimitiveScratchBuffer, tile_caches: &mut FastHashMap<SliceId, Box<TileCacheInstance>>, ) -> Option<(PictureContext, PictureState, PrimitiveList)>
pub fn restore_context( &mut self, pic_index: PictureIndex, prim_list: PrimitiveList, context: PictureContext, prim_instances: &[PrimitiveInstance], frame_context: &FrameBuildingContext<'_>, frame_state: &mut FrameBuildingState<'_>, )
sourcepub fn add_split_plane(
splitter: &mut BspSplitter<PlaneSplitAnchor>,
spatial_tree: &SpatialTree,
prim_spatial_node_index: SpatialNodeIndex,
original_local_rect: LayoutRect,
combined_local_clip_rect: &LayoutRect,
world_rect: WorldRect,
plane_split_anchor: PlaneSplitAnchor,
) -> bool
pub fn add_split_plane( splitter: &mut BspSplitter<PlaneSplitAnchor>, spatial_tree: &SpatialTree, prim_spatial_node_index: SpatialNodeIndex, original_local_rect: LayoutRect, combined_local_clip_rect: &LayoutRect, world_rect: WorldRect, plane_split_anchor: PlaneSplitAnchor, ) -> bool
Add a primitive instance to the plane splitter. The function would generate an appropriate polygon, clip it against the frustum, and register with the given plane splitter.
fn resolve_split_planes( splitter: &mut BspSplitter<PlaneSplitAnchor>, ordered: &mut Vec<OrderedPictureChild>, gpu_cache: &mut GpuCache, spatial_tree: &SpatialTree, )
sourcepub fn pre_update(&mut self, frame_context: &FrameBuildingContext<'_>)
pub fn pre_update(&mut self, frame_context: &FrameBuildingContext<'_>)
Do initial checks to determine whether this picture should be drawn as part of the frame build.
sourcepub fn assign_surface(
&mut self,
frame_context: &FrameBuildingContext<'_>,
parent_surface_index: Option<SurfaceIndex>,
tile_caches: &mut FastHashMap<SliceId, Box<TileCacheInstance>>,
surfaces: &mut Vec<SurfaceInfo>,
) -> Option<SurfaceIndex>
pub fn assign_surface( &mut self, frame_context: &FrameBuildingContext<'_>, parent_surface_index: Option<SurfaceIndex>, tile_caches: &mut FastHashMap<SliceId, Box<TileCacheInstance>>, surfaces: &mut Vec<SurfaceInfo>, ) -> Option<SurfaceIndex>
Called during initial picture traversal, before we know the bounding rect of children. It is possible to determine the surface / raster config now though.
sourcepub fn propagate_bounding_rect(
&mut self,
surface_index: SurfaceIndex,
parent_surface_index: Option<SurfaceIndex>,
surfaces: &mut [SurfaceInfo],
frame_context: &FrameBuildingContext<'_>,
)
pub fn propagate_bounding_rect( &mut self, surface_index: SurfaceIndex, parent_surface_index: Option<SurfaceIndex>, surfaces: &mut [SurfaceInfo], frame_context: &FrameBuildingContext<'_>, )
Called after updating child pictures during the initial picture traversal. Bounding rects are propagated from child pictures up to parent picture surfaces, so that the parent bounding rect includes any dynamic picture bounds.
pub fn prepare_for_render( &mut self, frame_state: &mut FrameBuildingState<'_>, data_stores: &mut DataStores, ) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PicturePrimitive
impl RefUnwindSafe for PicturePrimitive
impl Send for PicturePrimitive
impl Sync for PicturePrimitive
impl Unpin for PicturePrimitive
impl UnwindSafe for PicturePrimitive
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