summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-11-08 22:40:16 +0100
committerLibravatar GitHub <noreply@github.com>2019-11-08 22:40:16 +0100
commite66d38403d09b265f111d9e1b59af6143464d912 (patch)
tree4de0979a06a57818410986a4a613374aff746357 /wgpu
parentb31a80f2c0ca198f1bf0206618654415d2da460e (diff)
parent79f31b66c331207d9c5e1d31c226e49e8acb776f (diff)
downloadiced-e66d38403d09b265f111d9e1b59af6143464d912.tar.gz
iced-e66d38403d09b265f111d9e1b59af6143464d912.tar.bz2
iced-e66d38403d09b265f111d9e1b59af6143464d912.zip
Merge pull request #47 from hecrj/improvement/text-performance
Improve text rendering performance in some scenarios
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/renderer.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs
index 799cb30c..235eefc6 100644
--- a/wgpu/src/renderer.rs
+++ b/wgpu/src/renderer.rs
@@ -74,6 +74,7 @@ impl Renderer {
let glyph_brush =
GlyphBrushBuilder::using_fonts_bytes(vec![default_font, mono_font])
+ .initial_cache_size((2048, 2048))
.build(&mut device, TextureFormat::Bgra8UnormSrgb);
let quad_pipeline = quad::Pipeline::new(&mut device);
@@ -365,8 +366,8 @@ impl Renderer {
// Target physical coordinates directly to avoid blurry text
let text = Section {
screen_position: (
- text.screen_position.0 * dpi,
- text.screen_position.1 * dpi,
+ (text.screen_position.0 * dpi).round(),
+ (text.screen_position.1 * dpi).round(),
),
bounds: (text.bounds.0 * dpi, text.bounds.1 * dpi),
scale: wgpu_glyph::Scale {