summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-05 18:28:46 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-24 13:36:02 +0100
commit6cf4a10906e777645b6bf47faf0e7b8f3c36549e (patch)
treee60c8a19a968aaf567b55932a33501df6b7d12db
parent32309f0140efb4ea92e3e35e3adc5c740909f196 (diff)
downloadiced-6cf4a10906e777645b6bf47faf0e7b8f3c36549e.tar.gz
iced-6cf4a10906e777645b6bf47faf0e7b8f3c36549e.tar.bz2
iced-6cf4a10906e777645b6bf47faf0e7b8f3c36549e.zip
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.
Diffstat (limited to '')
-rw-r--r--wgpu/src/text.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index 6c88acc3..59a840ca 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -25,10 +25,6 @@ struct System {
#[borrows(fonts)]
#[not_covariant]
- cache: glyphon::SwashCache<'this>,
-
- #[borrows(fonts)]
- #[not_covariant]
measurement_cache: RefCell<Cache<'this>>,
#[borrows(fonts)]
@@ -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");
});