Skip to main content

PrimitiveDrawHeader

Struct PrimitiveDrawHeader 

Source
pub struct PrimitiveDrawHeader {
    pub prim_instance_index: PrimitiveInstanceIndex,
    pub clip_chain: ClipChainInstance,
    pub state: DrawState,
    pub clip_task_index: ClipTaskIndex,
    pub kind_scratch: KindScratchHandle,
    pub segment_instance_index: Index<BrushSegmentation>,
    pub compositor_surface_kind: CompositorSurfaceKind,
    pub snapped_local_rect: LayoutRect,
}
Expand description

Information stored for a visible primitive about the visible rect and associated clip information.

Fields§

§prim_instance_index: PrimitiveInstanceIndex

Back-reference to the prim instance this draw belongs to. Currently redundant with the identity-indexed lookup from scratch.frame.draws[PrimitiveInstanceIndex.0], but reserved for a follow-up that switches the storage to push-per-draw — readers iterating draws directly will need this to reach the instance.

§clip_chain: ClipChainInstance

The clip chain instance that was built for this primitive.

§state: DrawState

Current visibility state of the primitive.

§clip_task_index: ClipTaskIndex

An index into the clip task instances array in the primitive store. If this is ClipTaskIndex::INVALID, then the primitive has no clip mask. Otherwise, it may store the offset of the global clip mask task for this primitive, or the first of a list of clip task ids (one per segment).

§kind_scratch: KindScratchHandle

Per-kind scratch handle for this draw. Variant matches the drawn prim’s PrimitiveKind; None for kinds without per- frame scratch (e.g. ImageBorder, gradients, BackdropCapture, BoxShadow, Rectangle/YuvImage).

§segment_instance_index: Index<BrushSegmentation>

Index into PrimitiveFrameScratch.segment_instances for prims that opt into segmented brush rendering (Rectangle, YuvImage, non-tiled Image). UNUSED for prims that don’t segment, or for the trivial single-segment case. Built fresh each frame in build_segments_if_needed.

§compositor_surface_kind: CompositorSurfaceKind

Per-frame compositing decision for Image / YuvImage primitives. Set during the visibility pass by tile-cache promotion logic; Blit for kinds that aren’t candidates for compositor surfaces or for draws that didn’t get promoted this frame.

§snapped_local_rect: LayoutRect

Local-space rect of the primitive after device-pixel snapping has been applied. Populated for every prim each frame by frame_snap::snap_frame_rects (snapping PrimitiveInstance.unsnapped_prim_rect against the current spatial tree) before any visibility / prepare consumer reads it.

Implementations§

Source§

impl PrimitiveDrawHeader

Source

pub fn new() -> Self

Allocate a fresh draw header. snapped_local_rect is left at zero here; the per-frame snap pass overwrites it before any consumer runs.

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl Clone for PrimitiveDrawHeader

Source§

fn clone(&self) -> PrimitiveDrawHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PrimitiveDrawHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for PrimitiveDrawHeader

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

impl Copy for PrimitiveDrawHeader

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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