summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-24 16:48:24 +0100
committerLaurenz <laurmaedje@gmail.com>2022-01-24 17:39:49 +0100
commit3739ab77207e0e54edb55a110a16a1eb925b84f4 (patch)
tree06c8e5987d2fe070ad273ef94641161bbaef7095 /src/lib.rs
parentdb158719d67fdef1d2c76300fb232cf2d4bfb35d (diff)
Export into rendered images
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 39507d79..a764468b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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(),
}