Skip to main content

RenderFrame

Struct RenderFrame 

Source
pub struct RenderFrame {
    pub atlas_dirty: bool,
    pub atlas_width: u32,
    pub atlas_height: u32,
    pub atlas_pixels: Vec<u8>,
    pub glyphs: Vec<GlyphQuad>,
    pub images: Vec<ImageQuad>,
    pub decorations: Vec<DecorationRect>,
    /* private fields */
}
Expand description

Everything needed to draw one frame.

Produced by crate::Typesetter::render. Contains glyph quads (textured rectangles from the atlas), inline image placeholders, and decoration rectangles (selections, cursor, underlines, table borders, etc.).

The adapter draws the frame in three passes:

  1. Upload atlas_pixels as a GPU texture (only when atlas_dirty is true).
  2. Draw each GlyphQuad as a textured rectangle from the atlas.
  3. Draw each DecorationRect as a colored rectangle.

Fields§

§atlas_dirty: bool

True if the atlas texture changed since the last frame (needs re-upload).

§atlas_width: u32

Atlas texture width in pixels.

§atlas_height: u32

Atlas texture height in pixels.

§atlas_pixels: Vec<u8>

RGBA pixel data, row-major. Length = atlas_width * atlas_height * 4.

§glyphs: Vec<GlyphQuad>

One textured rectangle per visible glyph.

§images: Vec<ImageQuad>

Inline image placeholders. The adapter loads the actual image data (e.g., via TextDocument::resource(name)) and draws it at the given screen position.

§decorations: Vec<DecorationRect>

Decoration rectangles: selections, cursor, underlines, strikeouts, overlines, backgrounds, table borders, and cell backgrounds.

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 = 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.