summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wgpu/src/layer.rs15
-rw-r--r--wgpu/src/layer/text.rs5
2 files changed, 19 insertions, 1 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 557a7633..4ad12a88 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -177,6 +177,21 @@ impl<'a> Layer<'a> {
clip_bounds: *clip_bounds + translation,
}));
}
+ graphics::Primitive::RawText(graphics::text::Raw {
+ buffer,
+ position,
+ color,
+ clip_bounds,
+ }) => {
+ let layer = &mut layers[current_layer];
+
+ layer.text.push(Text::Raw(graphics::text::Raw {
+ buffer: buffer.clone(),
+ position: *position + translation,
+ color: *color,
+ clip_bounds: *clip_bounds + translation,
+ }));
+ }
Primitive::Quad {
bounds,
background,
diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs
index df2f2875..37ee5247 100644
--- a/wgpu/src/layer/text.rs
+++ b/wgpu/src/layer/text.rs
@@ -1,6 +1,7 @@
use crate::core::alignment;
use crate::core::text;
use crate::core::{Color, Font, Pixels, Point, Rectangle};
+use crate::graphics;
use crate::graphics::text::editor;
use crate::graphics::text::paragraph;
@@ -23,8 +24,10 @@ pub enum Text<'a> {
color: Color,
clip_bounds: Rectangle,
},
- /// A cached text.
+ /// Some cached text.
Cached(Cached<'a>),
+ /// Some raw text.
+ Raw(graphics::text::Raw),
}
#[derive(Debug, Clone)]