Skip to main content

TextCallBuffer

Struct TextCallBuffer 

Source
pub struct TextCallBuffer {
    pub calls: Vec<TextDrawCall>,
    /* private fields */
}
Expand description

An overlay draw list under assembly, with its recycled geometry pool.

Fields§

§calls: Vec<TextDrawCall>

Calls assembled so far, in draw order.

Implementations§

Source§

impl TextCallBuffer

Source

pub fn recycle(&mut self, spent: Vec<TextDrawCall>)

Reclaim a spent draw list: each call’s geometry feeds later builds and the drained list becomes the backing for the next calls.

Source

pub fn geometry(&mut self) -> (Vec<TextVertex>, Vec<u16>)

An empty vertex/index buffer pair, reusing spent capacity when any is pooled.

Source

pub fn park(&mut self, vertices: Vec<TextVertex>, indices: Vec<u16>)

Return a pair taken with TextCallBuffer::geometry that ended up unused, so its capacity stays pooled.

Source

pub fn take(&mut self) -> Vec<TextDrawCall>

Hand the assembled list to its consumer, leaving this buffer empty.

Source

pub fn sort_by_layer(&mut self)

Reorder the assembled calls by ascending draw layer, keeping same-layer calls in insertion order. Equivalent to a stable sort by layer, but the sort runs over indices in persistent scratch and the permutation is applied with swaps, so a steady-state frame allocates nothing. Skipped entirely when every call sits at layer 0.

Trait Implementations§

Source§

impl Debug for TextCallBuffer

Source§

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

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

impl Default for TextCallBuffer

Source§

fn default() -> TextCallBuffer

Returns the “default value” for a type. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.