Skip to content

Commit

Permalink
feat: expose draw_cache_multithread
Browse files Browse the repository at this point in the history
  • Loading branch information
yusdacra committed Jun 14, 2021
1 parent e68da22 commit 6469e46
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ canvas = ["iced_wgpu/canvas"]
qr_code = ["iced_wgpu/qr_code"]
# Enables using system fonts
default_system_font = ["iced_wgpu/default_system_font"]
# Enables draw_cache_multithread for glyph drawing
glyph_draw_cache_multithread = ["iced_wgpu/glyph_draw_cache_multithread"]
# Enables the `iced_glow` renderer. Overrides `iced_wgpu`
glow = ["iced_glow", "iced_glutin"]
# Enables the `Canvas` widget for `iced_glow`
Expand All @@ -33,6 +35,8 @@ glow_canvas = ["iced_glow/canvas"]
glow_qr_code = ["iced_glow/qr_code"]
# Enables using system fonts for `iced_glow`
glow_default_system_font = ["iced_glow/default_system_font"]
# Enables draw_cache_multithread for `iced_glow` glyph drawing
glow_glyph_draw_cache_multithread = ["iced_glow/glyph_draw_cache_multithread"]
# Enables a debug view in native platforms (press F12)
debug = ["iced_winit/debug"]
# Enables `tokio` as the `executor::Default` on native platforms
Expand Down
1 change: 1 addition & 0 deletions glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repository = "https://github.com/hecrj/iced"
canvas = ["iced_graphics/canvas"]
qr_code = ["iced_graphics/qr_code"]
default_system_font = ["iced_graphics/font-source"]
glyph_draw_cache_multithread = []
# Not supported yet!
image = []
svg = []
Expand Down
4 changes: 3 additions & 1 deletion glow/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ impl Pipeline {
let draw_brush =
glow_glyph::GlyphBrushBuilder::using_font(font.clone())
.initial_cache_size((2048, 2048))
.draw_cache_multithread(false) // TODO: Expose as a configuration flag
.draw_cache_multithread(cfg!(
feature = "glyph_draw_cache_multithread"
))
.build(&gl);

let measure_brush =
Expand Down
1 change: 1 addition & 0 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ farbfeld = ["image_rs/farbfeld"]
canvas = ["iced_graphics/canvas"]
qr_code = ["iced_graphics/qr_code"]
default_system_font = ["iced_graphics/font-source"]
glyph_draw_cache_multithread = []

[dependencies]
wgpu = "0.8"
Expand Down
4 changes: 3 additions & 1 deletion wgpu/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ impl Pipeline {
let draw_brush =
wgpu_glyph::GlyphBrushBuilder::using_font(font.clone())
.initial_cache_size((2048, 2048))
.draw_cache_multithread(false) // TODO: Expose as a configuration flag
.draw_cache_multithread(cfg!(
feature = "glyph_draw_cache_multithread"
))
.build(device, format);

let measure_brush =
Expand Down

0 comments on commit 6469e46

Please sign in to comment.