Struct webrender::prim_store::PrimitiveScratchBuffer

source ·
pub struct PrimitiveScratchBuffer {
Show 13 fields pub clip_mask_instances: Vec<ClipMaskKind>, pub glyph_keys: Storage<GlyphKey>, pub border_cache_handles: Storage<RenderTaskId>, pub segments: Storage<BrushSegment>, pub segment_instances: Storage<SegmentedInstance>, pub gradient_tiles: Storage<VisibleGradientTile>, pub debug_items: Vec<DebugItem>, messages: Vec<DebugMessage>, pub required_sub_graphs: HashSet<PictureIndex, BuildHasherDefault<FxHasher>>, pub quad_direct_segments: Vec<QuadSegment>, pub quad_color_segments: Vec<QuadSegment>, pub quad_indirect_segments: Vec<QuadSegment>, pub quad_tile_classifier: QuadTileClassifier,
}
Expand description

Contains various vecs of data that is used only during frame building, where we want to recycle the memory each new display list, to avoid constantly re-allocating and moving memory around. Written during primitive preparation, and read during batching.

Fields§

§clip_mask_instances: Vec<ClipMaskKind>

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

§glyph_keys: Storage<GlyphKey>

List of glyphs keys that are allocated by each text run instance.

§border_cache_handles: Storage<RenderTaskId>

List of render task handles for border segment instances that have been added this frame.

§segments: Storage<BrushSegment>

A list of brush segments that have been built for this scene.

§segment_instances: Storage<SegmentedInstance>

A list of segment ranges and GPU cache handles for prim instances that have opted into segment building. In future, this should be removed in favor of segment building during primitive interning.

§gradient_tiles: Storage<VisibleGradientTile>

A list of visible tiles that tiled gradients use to store per-tile information.

§debug_items: Vec<DebugItem>

List of debug display items for rendering.

§messages: Vec<DebugMessage>

List of current debug messages to log on screen

§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_color_segments: Vec<QuadSegment>§quad_indirect_segments: Vec<QuadSegment>§quad_tile_classifier: QuadTileClassifier

A retained classifier for checking which segments of a tiled primitive need a mask / are clipped / can be rendered directly

Implementations§

source§

impl PrimitiveScratchBuffer

source

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

source

pub fn begin_frame(&mut self)

source

pub fn end_frame(&mut self)

source

pub fn push_debug_rect_with_stroke_width( &mut self, rect: WorldRect, border: ColorF, stroke_width: f32, )

source

pub fn push_debug_rect( &mut self, rect: DeviceRect, outer_color: ColorF, inner_color: ColorF, )

source

pub fn push_debug_string( &mut self, position: DevicePoint, color: ColorF, msg: String, )

source

pub fn log(&mut self, msg: String)

Trait Implementations§

source§

impl Default for PrimitiveScratchBuffer

source§

fn default() -> Self

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

impl Serialize for PrimitiveScratchBuffer

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.