diff options
author | 2021-07-22 18:21:50 +0700 | |
---|---|---|
committer | 2021-07-22 18:21:50 +0700 | |
commit | 217f5be8272f48a5b043d066ed1788cc127e1164 (patch) | |
tree | ef09f2324d8d44d52938d34d8d007ff1bf681721 /glow/src/text.rs | |
parent | 6469e463cd1f99190c6eba4701d4c1059934d3ee (diff) | |
download | iced-217f5be8272f48a5b043d066ed1788cc127e1164.tar.gz iced-217f5be8272f48a5b043d066ed1788cc127e1164.tar.bz2 iced-217f5be8272f48a5b043d066ed1788cc127e1164.zip |
Add `text_multithreading` to `Settings` in `iced_glow` and `iced_wgpu`
Diffstat (limited to '')
-rw-r--r-- | glow/src/text.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/glow/src/text.rs b/glow/src/text.rs index 7c9574a2..a4c39dfe 100644 --- a/glow/src/text.rs +++ b/glow/src/text.rs @@ -11,7 +11,11 @@ pub struct Pipeline { } impl Pipeline { - pub fn new(gl: &glow::Context, default_font: Option<&[u8]>) -> Self { + pub fn new( + gl: &glow::Context, + default_font: Option<&[u8]>, + multithreading: bool, + ) -> Self { let default_font = default_font.map(|slice| slice.to_vec()); // TODO: Font customization @@ -41,9 +45,7 @@ impl Pipeline { let draw_brush = glow_glyph::GlyphBrushBuilder::using_font(font.clone()) .initial_cache_size((2048, 2048)) - .draw_cache_multithread(cfg!( - feature = "glyph_draw_cache_multithread" - )) + .draw_cache_multithread(multithreading) .build(&gl); let measure_brush = |