Add text_multithreading to Settings in iced_glow and iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2021-07-22 18:21:50 +07:00
parent 6469e463cd
commit 217f5be827
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
9 changed files with 31 additions and 16 deletions

View file

@ -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 =