Skip to main content

PrimitiveFrameScratch

Struct PrimitiveFrameScratch 

Source
pub struct PrimitiveFrameScratch {
Show 19 fields pub draws: Vec<PrimitiveDrawHeader>, pub line_decoration: Storage<LineDecorationScratch>, pub normal_border: Storage<NormalBorderScratch>, pub backdrop_render: Storage<BackdropRenderScratch>, pub pictures: Storage<PictureScratch>, pub images: Storage<ImageScratch>, pub visible_image_tiles: Storage<VisibleImageTile>, pub text_runs: Storage<TextRunScratch>, pub glyph_keys: Storage<GlyphKey>, pub segments: Storage<BrushSegment>, pub segment_instances: Storage<BrushSegmentation>, pub border_task_ids: Storage<RenderTaskId>, pub border_segments: Storage<BorderSegmentInfo>, pub image_border: Storage<ImageBorderScratch>, pub clip_mask_instances: Vec<ClipMaskKind>, pub debug_items: Vec<DebugItem>, pub required_sub_graphs: HashSet<PictureIndex, BuildHasherDefault<FxHasher>>, pub quad_direct_segments: Vec<QuadSegment>, pub quad_indirect_segments: Vec<QuadSegment>,
}
Expand description

Per-frame scratch storage. All fields are cleared every frame in begin_frame. Anything written here lives only for the current frame.

Fields§

§draws: Vec<PrimitiveDrawHeader>

Per-frame draw headers, one entry per PrimitiveInstance. Resized to prim_instances.len() at frame start and identity- indexed by PrimitiveInstanceIndex.0 (a follow-up will switch this to push-per-draw with Index<PrimitiveDrawHeader>). Holds visibility state, clip chain and clip-task index for each visible primitive.

§line_decoration: Storage<LineDecorationScratch>

Per-frame scratch for LineDecoration primitives.

§normal_border: Storage<NormalBorderScratch>

Per-frame scratch for NormalBorder primitives.

§backdrop_render: Storage<BackdropRenderScratch>

Per-frame scratch for BackdropRender primitives. Captures the source sub-graph render task id at prepare time so batch reads don’t reach into the source Picture’s per-frame state.

§pictures: Storage<PictureScratch>

Per-frame scratch for Picture primitives. Holds the picture’s primary/secondary render task ids and any per-composite-mode extra GPU buffer addresses. Indexed by scratch_handle on PrimitiveKind::Picture.

§images: Storage<ImageScratch>

Per-frame scratch for Image primitives. Holds the source render task (or a Range of per-tile tasks for tiled images), normalized- uvs flag, and image adjustment.

§visible_image_tiles: Storage<VisibleImageTile>

Per-tile entries for tiled Image primitives. Each ImageScratch holds a Range into this storage.

§text_runs: Storage<TextRunScratch>

Per-frame scratch for TextRun primitives. Holds the per-frame font snapshot, glyph-key range, snapping offset, and raster scale for each visible text run.

§glyph_keys: Storage<GlyphKey>

Per-frame storage for glyph keys allocated by visible text runs. Each TextRunScratch holds a Range into this storage. Used to be on PrimitiveSceneCache (memoized across frames); graduated to per-frame here so the scene buffer cannot grow unbounded between scene rebuilds.

§segments: Storage<BrushSegment>

A list of brush segments built each frame for the segmented brush primitives (Rectangle, YuvImage, non-tiled Image). The segment builder runs every frame for every visible segmented prim.

§segment_instances: Storage<BrushSegmentation>

A list of per-prim brush segmentation records (segments range

  • GPU buffer address). Each PrimitiveDrawHeader.segment_instance_index holds an index into this storage, or UNUSED for non-segmented prims.
§border_task_ids: Storage<RenderTaskId>

Trailing-array store for per-segment cached render-task ids referenced by NormalBorderScratch entries.

§border_segments: Storage<BorderSegmentInfo>

Per-frame BorderSegmentInfo arena. NormalBorder builds its edge/corner segment list each frame against the prim’s size and stores the resulting range on NormalBorderScratch.

§image_border: Storage<ImageBorderScratch>

Per-frame scratch for ImageBorder primitives. Holds the range into segments for the nine-patch brush segments built each frame against the prim’s size.

§clip_mask_instances: Vec<ClipMaskKind>

Contains a list of clip mask instance parameters per segment generated.

§debug_items: Vec<DebugItem>

List of debug display items for rendering. Cleared in begin_frame and refilled in end_frame (where retained messages are flushed into it for on-screen display).

§required_sub_graphs: HashSet<PictureIndex, BuildHasherDefault<FxHasher>>

Set of sub-graphs that are required, determined during visibility pass

§quad_direct_segments: Vec<QuadSegment>

Temporary buffers for building segments in to during prepare pass

§quad_indirect_segments: Vec<QuadSegment>

Implementations§

Source§

impl PrimitiveFrameScratch

Source

pub fn recycle(&mut self, recycler: &mut Recycler)

Source

pub fn begin_frame(&mut self)

Trait Implementations§

Source§

impl Default for PrimitiveFrameScratch

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Serialize for PrimitiveFrameScratch

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