pub struct Resources {
pub(crate) image_registry: ImageRegistry,
pub(crate) glyph_prep_cache: GlyphPrepCache,
pub(crate) glyph_resources: Option<GlyphAtlasResources>,
}Expand description
Persistent resources required by Vello CPU for rendering.
You should create one such instance per renderer.
Fields§
§image_registry: ImageRegistry§glyph_prep_cache: GlyphPrepCache§glyph_resources: Option<GlyphAtlasResources>Implementations§
Source§impl Resources
impl Resources
pub(crate) fn before_render(&mut self, render_mode: RenderMode)
pub(crate) fn after_render(&mut self)
Source§impl Resources
Image registry implementation.
impl Resources
Image registry implementation.
Sourcepub fn register_image(&mut self, pixmap: Arc<Pixmap>) -> ImageId
pub fn register_image(&mut self, pixmap: Arc<Pixmap>) -> ImageId
Register a pixmap in the image registry and return its ImageId.
Sourcepub fn destroy_image(&mut self, id: ImageId) -> bool
pub fn destroy_image(&mut self, id: ImageId) -> bool
Remove an image from the registry.
Sourcepub fn resolve_image(&self, id: ImageId) -> Option<Arc<Pixmap>>
pub fn resolve_image(&self, id: ImageId) -> Option<Arc<Pixmap>>
Resolve an ImageId to its pixmap data.
Sourcepub fn clear_images(&mut self)
pub fn clear_images(&mut self)
Clear the image registry.
Source§impl Resources
impl Resources
pub(crate) fn prepare_glyph_cache(&mut self, render_mode: RenderMode)
pub(crate) fn maintain_glyph_cache(&mut self)
fn ensure_glyph_resources(&mut self, level: Level)
Sourcefn sync_glyph_cache(&mut self, render_mode: RenderMode)
fn sync_glyph_cache(&mut self, render_mode: RenderMode)
Upload all pending bitmaps, rasterize pending outline/COLR glyphs, etc.
fn clear_evicted_glyph_atlas_regions(&mut self)
Source§impl Resources
impl Resources
pub(crate) fn save_glyph_atlas_pages(&self)
pub(crate) fn save_glyph_atlas_pages_to(&self, path_prefix: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resources
impl !RefUnwindSafe for Resources
impl Send for Resources
impl !Sync for Resources
impl Unpin for Resources
impl UnsafeUnpin for Resources
impl !UnwindSafe for Resources
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more