summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-14 12:49:49 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-14 12:49:49 +0100
commit9489e29e6619b14ed9f41a8887c4b34158266f71 (patch)
tree34b574112df5f2e63dff66d3a01e470077ce7c9b /wgpu/src/layer.rs
parent2dda9132cda6d2a2279759f3447bae4e1c277555 (diff)
downloadiced-9489e29e6619b14ed9f41a8887c4b34158266f71.tar.gz
iced-9489e29e6619b14ed9f41a8887c4b34158266f71.tar.bz2
iced-9489e29e6619b14ed9f41a8887c4b34158266f71.zip
Re-organize `custom` module as `pipeline` module
... and move `Shader` widget to `iced_widget` crate
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r--wgpu/src/layer.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index d451cbfd..33aaf670 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -35,8 +35,8 @@ pub struct Layer<'a> {
/// The images of the [`Layer`].
pub images: Vec<Image>,
- /// The custom shader primitives of this [`Layer`].
- pub shaders: Vec<primitive::Shader>,
+ /// The custom pipelines of this [`Layer`].
+ pub pipelines: Vec<primitive::Pipeline>,
}
impl<'a> Layer<'a> {
@@ -48,7 +48,7 @@ impl<'a> Layer<'a> {
meshes: Vec::new(),
text: Vec::new(),
images: Vec::new(),
- shaders: Vec::new(),
+ pipelines: Vec::new(),
}
}
@@ -312,16 +312,21 @@ impl<'a> Layer<'a> {
}
}
},
- primitive::Custom::Shader(shader) => {
+ primitive::Custom::Pipeline(pipeline) => {
let layer = &mut layers[current_layer];
let bounds = Rectangle::new(
Point::new(translation.x, translation.y),
- shader.bounds.size(),
+ pipeline.bounds.size(),
);
- if layer.bounds.intersection(&bounds).is_some() {
- layer.shaders.push(shader.clone());
+ if let Some(clip_bounds) =
+ layer.bounds.intersection(&bounds)
+ {
+ layer.pipelines.push(primitive::Pipeline {
+ bounds: clip_bounds,
+ primitive: pipeline.primitive.clone(),
+ });
}
}
},