Skip to main content

PictureInstance

Struct PictureInstance 

Source
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: 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.

§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: 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.

§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.

§snapshot: Option<SnapshotInfo>

If provided, cache the content of this picture into an image associated with the image key.

Implementations§

Source§

impl PictureInstance

Source

pub fn print<T: PrintTreePrinter>( &self, pictures: &[Self], self_index: PictureIndex, pt: &mut T, )

Source

pub fn resolve_scene_properties(&mut self, properties: &SceneProperties)

Source

pub fn is_visible(&self, spatial_tree: &SpatialTree) -> bool

Source

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

Source

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>)>

Source

pub fn restore_context( &mut self, pic_index: PictureIndex, prim_list: PrimitiveList, context: PictureContext, frame_context: &FrameBuildingContext<'_>, frame_state: &mut FrameBuildingState<'_>, scratch: &PrimitiveScratchBuffer, )

Source

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.

Source

fn resolve_split_planes( splitter: &mut BspSplitter<PlaneSplitAnchor>, ordered: &mut Vec<OrderedPictureChild>, gpu_buffer: &mut GpuBufferBuilderImpl<GpuBufferBlockF>, ancestor_index: SpatialNodeIndex, spatial_tree: &SpatialTree, )

Source

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.

Source

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.

Source

pub fn write_gpu_blocks( &mut self, frame_state: &mut FrameBuildingState<'_>, data_stores: &mut DataStores, scratch: &mut PictureScratch, )

Source

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§

Source§

impl Serialize for PictureInstance

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.
Source§

impl<'a, T> Deserialize<'a> for T