diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 12 |
1 files changed, 0 insertions, 12 deletions
@@ -62,7 +62,6 @@ use crate::export::RenderCache; use crate::font::FontStore; use crate::frame::Frame; use crate::image::ImageStore; -#[cfg(feature = "layout-cache")] use crate::layout::{EvictionPolicy, LayoutCache}; use crate::loading::Loader; use crate::source::{SourceId, SourceStore}; @@ -78,7 +77,6 @@ pub struct Context { /// Stores decoded images. pub images: ImageStore, /// Caches layouting artifacts. - #[cfg(feature = "layout-cache")] pub layout_cache: LayoutCache, /// Caches rendering artifacts. pub render_cache: RenderCache, @@ -120,7 +118,6 @@ impl Context { /// Garbage-collect caches. pub fn turnaround(&mut self) { - #[cfg(feature = "layout-cache")] self.layout_cache.turnaround(); } } @@ -131,9 +128,7 @@ impl Context { pub struct ContextBuilder { std: Option<Scope>, styles: Option<StyleMap>, - #[cfg(feature = "layout-cache")] policy: EvictionPolicy, - #[cfg(feature = "layout-cache")] max_size: usize, } @@ -152,7 +147,6 @@ impl ContextBuilder { } /// The policy for eviction of the layout cache. - #[cfg(feature = "layout-cache")] pub fn cache_policy(mut self, policy: EvictionPolicy) -> Self { self.policy = policy; self @@ -162,7 +156,6 @@ impl ContextBuilder { /// /// Note that this can be exceeded if more entries are categorized as [must /// keep][crate::layout::PatternProperties::must_keep]. - #[cfg(feature = "layout-cache")] pub fn cache_max_size(mut self, max_size: usize) -> Self { self.max_size = max_size; self @@ -176,7 +169,6 @@ impl ContextBuilder { fonts: FontStore::new(Arc::clone(&loader)), images: ImageStore::new(Arc::clone(&loader)), loader, - #[cfg(feature = "layout-cache")] layout_cache: LayoutCache::new(self.policy, self.max_size), render_cache: RenderCache::new(), std: self.std.unwrap_or_else(library::new), @@ -190,9 +182,7 @@ impl Default for ContextBuilder { Self { std: None, styles: None, - #[cfg(feature = "layout-cache")] policy: EvictionPolicy::default(), - #[cfg(feature = "layout-cache")] max_size: 2000, } } @@ -209,7 +199,6 @@ pub struct Vm<'a> { /// Stores decoded images. pub images: &'a mut ImageStore, /// Caches layouting artifacts. - #[cfg(feature = "layout-cache")] pub layout_cache: &'a mut LayoutCache, /// The default styles. pub styles: &'a StyleMap, @@ -223,7 +212,6 @@ pub struct Vm<'a> { /// rules. pub rules: Vec<TypeId>, /// How deeply nested the current layout tree position is. - #[cfg(feature = "layout-cache")] pub level: usize, } |
