pub struct PrimitiveScratchBuffer {
pub frame: PrimitiveFrameScratch,
pub scene: PrimitiveSceneCache,
pub retained: PrimitiveRetained,
}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.
Storage is partitioned by lifetime: frame is per-frame (cleared in
begin_frame), scene is per-scene (recycled on scene rebuild), and
retained lives across both with its own trim policy.
Fields§
§frame: PrimitiveFrameScratch§scene: PrimitiveSceneCache§retained: PrimitiveRetainedImplementations§
Source§impl PrimitiveScratchBuffer
impl PrimitiveScratchBuffer
pub fn recycle(&mut self, recycler: &mut Recycler)
pub fn begin_frame(&mut self)
pub fn end_frame(&mut self)
pub fn push_debug_rect_with_stroke_width( &mut self, rect: WorldRect, border: ColorF, stroke_width: f32, )
pub fn push_debug_rect( &mut self, rect: DeviceRect, thickness: i32, outer_color: ColorF, inner_color: ColorF, )
pub fn push_debug_string( &mut self, position: DevicePoint, color: ColorF, msg: String, )
pub fn log(&mut self, msg: String)
Trait Implementations§
Source§impl Default for PrimitiveScratchBuffer
impl Default for PrimitiveScratchBuffer
Source§fn default() -> PrimitiveScratchBuffer
fn default() -> PrimitiveScratchBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PrimitiveScratchBuffer
impl RefUnwindSafe for PrimitiveScratchBuffer
impl Send for PrimitiveScratchBuffer
impl Sync for PrimitiveScratchBuffer
impl Unpin for PrimitiveScratchBuffer
impl UnsafeUnpin for PrimitiveScratchBuffer
impl UnwindSafe for PrimitiveScratchBuffer
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
Mutably borrows from an owned value. Read more
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>
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 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>
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