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

source

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

source

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

source

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

source

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.

source

fn resolve_split_planes( splitter: &mut BspSplitter<PlaneSplitAnchor>, ordered: &mut Vec<OrderedPictureChild>, gpu_cache: &mut GpuCache, spatial_tree: &SpatialTree, )

source

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.

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 prepare_for_render( &mut self, frame_state: &mut FrameBuildingState<'_>, data_stores: &mut DataStores, ) -> bool

Trait Implementations§

source§

impl Serialize for PicturePrimitive

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

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

§

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

§

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.