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: PrimitiveInstanceIndexBack-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: ClipChainInstanceThe clip chain instance that was built for this primitive.
state: DrawStateCurrent visibility state of the primitive.
clip_task_index: ClipTaskIndexAn 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: KindScratchHandlePer-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: CompositorSurfaceKindPer-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: LayoutRectLocal-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§
Trait Implementations§
Source§impl Clone for PrimitiveDrawHeader
impl Clone for PrimitiveDrawHeader
Source§fn clone(&self) -> PrimitiveDrawHeader
fn clone(&self) -> PrimitiveDrawHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrimitiveDrawHeader
impl Debug for PrimitiveDrawHeader
Source§impl Serialize for PrimitiveDrawHeader
impl Serialize for PrimitiveDrawHeader
impl Copy for PrimitiveDrawHeader
Auto Trait Implementations§
impl Freeze for PrimitiveDrawHeader
impl RefUnwindSafe for PrimitiveDrawHeader
impl Send for PrimitiveDrawHeader
impl Sync for PrimitiveDrawHeader
impl Unpin for PrimitiveDrawHeader
impl UnsafeUnpin for PrimitiveDrawHeader
impl UnwindSafe for PrimitiveDrawHeader
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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