pub struct PictureInstance {
pub prim_list: PrimitiveList,
pub is_backface_visible: bool,
pub composite_mode: Option<PictureCompositeMode>,
pub raster_config: Option<RasterConfig>,
pub context_3d: Picture3DContext<OrderedPictureChild>,
pub spatial_node_index: SpatialNodeIndex,
pub prev_local_rect: LayoutRect,
pub segments_are_valid: bool,
pub raster_space: RasterSpace,
pub flags: PictureFlags,
pub clip_root: Option<ClipNodeId>,
pub snapshot: Option<SnapshotInfo>,
}Fields§
§prim_list: PrimitiveListList of primitives, and associated info for this picture.
is_backface_visible: boolIf false and transform ends up showing the back of the picture, it will be considered invisible.
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>§spatial_node_index: SpatialNodeIndexThe spatial node index of this picture when it is composited into the parent picture.
prev_local_rect: LayoutRectStore 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: boolIf 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.
raster_space: RasterSpaceRequested raster space for this picture
flags: PictureFlagsFlags 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.
snapshot: Option<SnapshotInfo>If provided, cache the content of this picture into an image associated with the image key.
Implementations§
Source§impl PictureInstance
impl PictureInstance
pub fn print<T: PrintTreePrinter>( &self, pictures: &[Self], self_index: PictureIndex, pt: &mut T, )
pub 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, snapshot: Option<SnapshotInfo>, ) -> 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, Index<PictureScratch>)>
pub fn restore_context( &mut self, pic_index: PictureIndex, prim_list: PrimitiveList, context: PictureContext, frame_context: &FrameBuildingContext<'_>, frame_state: &mut FrameBuildingState<'_>, scratch: &PrimitiveScratchBuffer, )
Sourcepub fn add_split_plane(
splitter: &mut BspSplitter<PlaneSplitAnchor>,
spatial_tree: &SpatialTree,
prim_spatial_node_index: SpatialNodeIndex,
ancestor_spatial_node_index: SpatialNodeIndex,
visibility_spatial_node_index: SpatialNodeIndex,
original_local_rect: LayoutRect,
combined_local_clip_rect: &LayoutRect,
dirty_rect: VisRect,
plane_split_anchor: PlaneSplitAnchor,
) -> bool
pub fn add_split_plane( splitter: &mut BspSplitter<PlaneSplitAnchor>, spatial_tree: &SpatialTree, prim_spatial_node_index: SpatialNodeIndex, ancestor_spatial_node_index: SpatialNodeIndex, visibility_spatial_node_index: SpatialNodeIndex, original_local_rect: LayoutRect, combined_local_clip_rect: &LayoutRect, dirty_rect: VisRect, 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_buffer: &mut GpuBufferBuilderImpl<GpuBufferBlockF>, ancestor_index: SpatialNodeIndex, spatial_tree: &SpatialTree, )
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 write_gpu_blocks( &mut self, frame_state: &mut FrameBuildingState<'_>, data_stores: &mut DataStores, scratch: &mut PictureScratch, )
fn draw_debug_overlay( &self, parent_surface_index: Option<SurfaceIndex>, frame_state: &FrameBuildingState<'_>, frame_context: &FrameBuildingContext<'_>, tile_caches: &FastHashMap<SliceId, Box<TileCacheInstance>>, scratch: &mut PrimitiveScratchBuffer, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PictureInstance
impl RefUnwindSafe for PictureInstance
impl Send for PictureInstance
impl Sync for PictureInstance
impl Unpin for PictureInstance
impl UnsafeUnpin for PictureInstance
impl UnwindSafe for PictureInstance
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