Skip to main content

AtlasCommandRecorder

Struct AtlasCommandRecorder 

Source
pub struct AtlasCommandRecorder {
    pub page_index: u32,
    pub commands: Vec<AtlasCommand>,
    pub(crate) width: u16,
    pub(crate) height: u16,
}
Expand description

Records atlas draw commands for a single atlas page.

The recorder exposes the same method API as the actual renderers (RenderContext, Scene). It also implements DrawSink so that the COLR glyph painter can write into it directly.

Fields§

§page_index: u32

Which atlas page these commands target.

§commands: Vec<AtlasCommand>

The recorded commands.

§width: u16

Width of the glyph renderer / atlas page (pixels).

§height: u16

Height of the glyph renderer / atlas page (pixels).

Implementations§

Source§

impl AtlasCommandRecorder

Source

pub fn new(page_index: u32, width: u16, height: u16) -> Self

Create a new recorder for the given atlas page.

width and height must match the glyph renderer dimensions (i.e. the atlas page size) so that COLR fill_solid / fill_gradient produce correctly-sized fill rects.

Trait Implementations§

Source§

impl Debug for AtlasCommandRecorder

Source§

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

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

impl DrawSink for AtlasCommandRecorder

Source§

fn set_transform(&mut self, t: Affine)

Set the current transform.
Source§

fn set_paint(&mut self, paint: AtlasPaint)

Set the current paint.
Source§

fn set_paint_transform(&mut self, t: Affine)

Set the paint transform.
Source§

fn fill_path(&mut self, path: &BezPath)

Fill a path with the current paint and transform.
Source§

fn fill_rect(&mut self, rect: &Rect)

Fill a rectangle with the current paint and transform.
Source§

fn push_clip_layer(&mut self, clip: &BezPath)

Push a clip layer defined by a path.
Source§

fn push_clip_path(&mut self, clip: &BezPath)

Push a clip path. Read more
Source§

fn push_blend_layer(&mut self, blend_mode: BlendMode)

Push a blend/compositing layer.
Source§

fn pop_layer(&mut self)

Pop the most recent clip or blend layer.
Source§

fn pop_clip_path(&mut self)

Pop the most recent clip path. Read more
Source§

fn width(&self) -> u16

Width of the surface.
Source§

fn height(&self) -> u16

Height of the surface.

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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.