Stop reusing SwashCache in text::Pipeline

`SwashCache` can't be easily trimmed and it's not really getting us
anything since `glyphon` already caches using a glyph atlas anyways.
This commit is contained in:
Héctor Ramón Jiménez 2023-02-05 18:28:46 +01:00
parent 32309f0140
commit 6cf4a10906
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -23,10 +23,6 @@ pub struct Pipeline {
struct System {
fonts: glyphon::FontSystem,
#[borrows(fonts)]
#[not_covariant]
cache: glyphon::SwashCache<'this>,
#[borrows(fonts)]
#[not_covariant]
measurement_cache: RefCell<Cache<'this>>,
@ -52,7 +48,6 @@ impl Pipeline {
))]
.into_iter(),
),
cache_builder: |fonts| glyphon::SwashCache::new(fonts),
measurement_cache_builder: |_| RefCell::new(Cache::new()),
render_cache_builder: |_| Cache::new(),
}
@ -76,7 +71,6 @@ impl Pipeline {
self.system = Some(
SystemBuilder {
fonts: glyphon::FontSystem::new_with_locale_and_db(locale, db),
cache_builder: |fonts| glyphon::SwashCache::new(fonts),
measurement_cache_builder: |_| RefCell::new(Cache::new()),
render_cache_builder: |_| Cache::new(),
}
@ -183,7 +177,7 @@ impl Pipeline {
},
&text_areas,
glyphon::Color::rgb(0, 0, 0),
fields.cache,
&mut glyphon::SwashCache::new(fields.fonts),
)
.expect("Prepare text sections");
});