pub struct GlyphCache { /* private fields */ }Expand description
Per-frame glyph vertex cache shared by one [GlGfxCtx] instance.
Create once alongside GlGfxCtx::new and keep alive for the lifetime of
the rendering context. Do not clear between frames.
Implementations§
Source§impl GlyphCache
impl GlyphCache
Sourcepub fn get_or_insert(
&mut self,
font: &Font,
glyph_id: u16,
size: f64,
) -> Option<&CachedGlyph>
pub fn get_or_insert( &mut self, font: &Font, glyph_id: u16, size: f64, ) -> Option<&CachedGlyph>
Return the cached tessellation for (font, glyph_id, size), tessellating
on first access.
Returns None for glyphs with no visible outline (space, tab, etc.).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GlyphCache
impl RefUnwindSafe for GlyphCache
impl Send for GlyphCache
impl Sync for GlyphCache
impl Unpin for GlyphCache
impl UnsafeUnpin for GlyphCache
impl UnwindSafe for GlyphCache
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