diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-24 16:48:24 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-24 17:39:49 +0100 |
| commit | 3739ab77207e0e54edb55a110a16a1eb925b84f4 (patch) | |
| tree | 06c8e5987d2fe070ad273ef94641161bbaef7095 /src/lib.rs | |
| parent | db158719d67fdef1d2c76300fb232cf2d4bfb35d (diff) | |
Export into rendered images
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -56,6 +56,7 @@ use std::rc::Rc; use crate::diag::TypResult; use crate::eval::{Eval, EvalContext, Module, Scope, StyleMap}; +use crate::export::RenderCache; use crate::font::FontStore; use crate::frame::Frame; use crate::image::ImageStore; @@ -76,7 +77,9 @@ pub struct Context { pub images: ImageStore, /// Caches layouting artifacts. #[cfg(feature = "layout-cache")] - pub layouts: LayoutCache, + pub layout_cache: LayoutCache, + /// Caches rendering artifacts. + pub render_cache: RenderCache, /// The standard library scope. std: Scope, /// The default styles. @@ -131,7 +134,7 @@ impl Context { /// Garbage-collect caches. pub fn turnaround(&mut self) { #[cfg(feature = "layout-cache")] - self.layouts.turnaround(); + self.layout_cache.turnaround(); } } @@ -187,7 +190,8 @@ impl ContextBuilder { images: ImageStore::new(Rc::clone(&loader)), loader, #[cfg(feature = "layout-cache")] - layouts: LayoutCache::new(self.policy, self.max_size), + layout_cache: LayoutCache::new(self.policy, self.max_size), + render_cache: RenderCache::new(), std: self.std.unwrap_or_else(library::new), styles: self.styles.unwrap_or_default(), } |
