summaryrefslogtreecommitdiffstats
path: root/wgpu/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-07-07 07:12:37 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-07-20 20:47:38 +0200
commit95ff96f71f8f8069608ad08985e2b1214dd42284 (patch)
treebd3a902ad36f9b7aa5c00fc26d748d4f8dbeda23 /wgpu/src/text.rs
parentfd077918db7643530c3a7318ed5777d2f3d8761b (diff)
downloadiced-95ff96f71f8f8069608ad08985e2b1214dd42284.tar.gz
iced-95ff96f71f8f8069608ad08985e2b1214dd42284.tar.bz2
iced-95ff96f71f8f8069608ad08985e2b1214dd42284.zip
Update `cosmic-text` and `glyphon`
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r--wgpu/src/text.rs22
1 files changed, 6 insertions, 16 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index 65d3b818..ef910c39 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -35,7 +35,7 @@ impl Pipeline {
.into_iter(),
)),
renderers: Vec::new(),
- atlas: glyphon::TextAtlas::new(
+ atlas: glyphon::TextAtlas::with_color_mode(
device,
queue,
format,
@@ -66,7 +66,7 @@ impl Pipeline {
bounds: Rectangle,
scale_factor: f32,
target_size: Size<u32>,
- ) -> bool {
+ ) {
if self.renderers.len() <= self.prepare_layer {
self.renderers.push(glyphon::TextRenderer::new(
&mut self.atlas,
@@ -188,21 +188,11 @@ impl Pipeline {
match result {
Ok(()) => {
self.prepare_layer += 1;
-
- true
}
- Err(glyphon::PrepareError::AtlasFull(content_type)) => {
- self.prepare_layer = 0;
-
- #[allow(clippy::needless_bool)]
- if self.atlas.grow(device, content_type) {
- false
- } else {
- // If the atlas cannot grow, then all bets are off.
- // Instead of panicking, we will just pray that the result
- // will be somewhat readable...
- true
- }
+ Err(glyphon::PrepareError::AtlasFull) => {
+ // If the atlas cannot grow, then all bets are off.
+ // Instead of panicking, we will just pray that the result
+ // will be somewhat readable...
}
}
}