pub struct GlyphCache { /* private fields */ }Expand description
Glyph cache with LRU eviction.
Implementations§
Source§impl GlyphCache
impl GlyphCache
Sourcepub fn get(&mut self, ch: u32, size_px: u16) -> Option<&GlyphBitmap>
pub fn get(&mut self, ch: u32, size_px: u16) -> Option<&GlyphBitmap>
Look up a cached glyph.
Sourcepub fn insert(&mut self, ch: u32, size_px: u16, bitmap: GlyphBitmap)
pub fn insert(&mut self, ch: u32, size_px: u16, bitmap: GlyphBitmap)
Insert a glyph bitmap into the cache.
Sourcepub fn hit_rate_percent(&self) -> u32
pub fn hit_rate_percent(&self) -> u32
Get cache hit rate as a percentage (0-100).