pub struct Atlas { /* private fields */ }Expand description
CPU side of the atlases: allocation, key lookup and pending uploads.
Implementations§
Source§impl Atlas
impl Atlas
pub fn new() -> Self
Sourcepub fn get_or_insert_with<'a>(
&mut self,
key: AtlasKey,
build: impl FnOnce() -> Option<AtlasImage<'a>>,
) -> Option<AtlasTile>
pub fn get_or_insert_with<'a>( &mut self, key: AtlasKey, build: impl FnOnce() -> Option<AtlasImage<'a>>, ) -> Option<AtlasTile>
Returns the tile for key, rasterizing it with build on first use.
build returning None (e.g. whitespace glyphs) is cached as well.
Sourcepub fn remove(&mut self, key: &AtlasKey)
pub fn remove(&mut self, key: &AtlasKey)
Frees the tile for key (e.g. when an image is dropped).
pub fn contains(&self, key: &AtlasKey) -> bool
pub fn layer_count(&self, kind: AtlasKind) -> u32
pub fn tile_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Atlas
impl RefUnwindSafe for Atlas
impl Send for Atlas
impl Sync for Atlas
impl Unpin for Atlas
impl UnsafeUnpin for Atlas
impl UnwindSafe for Atlas
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