summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r--wgpu/src/layer.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 33aaf670..98e49f1a 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -1,11 +1,13 @@
//! Organize rendering primitives into a flattened list of layers.
mod image;
+mod pipeline;
mod text;
pub mod mesh;
pub use image::Image;
pub use mesh::Mesh;
+pub use pipeline::Pipeline;
pub use text::Text;
use crate::core;
@@ -36,7 +38,7 @@ pub struct Layer<'a> {
pub images: Vec<Image>,
/// The custom pipelines of this [`Layer`].
- pub pipelines: Vec<primitive::Pipeline>,
+ pub pipelines: Vec<Pipeline>,
}
impl<'a> Layer<'a> {
@@ -314,17 +316,14 @@ impl<'a> Layer<'a> {
},
primitive::Custom::Pipeline(pipeline) => {
let layer = &mut layers[current_layer];
-
- let bounds = Rectangle::new(
- Point::new(translation.x, translation.y),
- pipeline.bounds.size(),
- );
+ let bounds = pipeline.bounds + translation;
if let Some(clip_bounds) =
layer.bounds.intersection(&bounds)
{
- layer.pipelines.push(primitive::Pipeline {
- bounds: clip_bounds,
+ layer.pipelines.push(Pipeline {
+ bounds,
+ viewport: clip_bounds,
primitive: pipeline.primitive.clone(),
});
}