summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-03 03:55:07 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-03 03:55:07 +0100
commitbbeaf10c04a922af5c1c3b898f0c4301d23feab0 (patch)
treeb0d2b64d72ae29db324de7614b37af9c6ab68b54
parent868f79d22e2be82e98b06d66da3b4cbc6139d7c7 (diff)
downloadiced-bbeaf10c04a922af5c1c3b898f0c4301d23feab0.tar.gz
iced-bbeaf10c04a922af5c1c3b898f0c4301d23feab0.tar.bz2
iced-bbeaf10c04a922af5c1c3b898f0c4301d23feab0.zip
Mark `Primitive` as `non-exhaustive` in `iced_graphics`
-rw-r--r--graphics/Cargo.toml5
-rw-r--r--graphics/src/primitive.rs3
-rw-r--r--tiny_skia/Cargo.toml1
-rw-r--r--wgpu/src/layer.rs3
4 files changed, 9 insertions, 3 deletions
diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml
index 36d8a516..62e67cf8 100644
--- a/graphics/Cargo.toml
+++ b/graphics/Cargo.toml
@@ -34,7 +34,6 @@ log = "0.4"
raw-window-handle = "0.5"
thiserror = "1.0"
bitflags = "1.2"
-tiny-skia = "0.8"
[dependencies.bytemuck]
version = "1.4"
@@ -48,6 +47,10 @@ path = "../native"
version = "0.7"
path = "../style"
+[dependencies.tiny-skia]
+version = "0.8"
+optional = true
+
[dependencies.image_rs]
version = "0.24"
package = "image"
diff --git a/graphics/src/primitive.rs b/graphics/src/primitive.rs
index e4826591..5a48639d 100644
--- a/graphics/src/primitive.rs
+++ b/graphics/src/primitive.rs
@@ -9,6 +9,7 @@ use std::sync::Arc;
/// A rendering primitive.
#[derive(Debug, Clone)]
+#[non_exhaustive]
pub enum Primitive {
/// A text primitive
Text {
@@ -85,12 +86,14 @@ pub enum Primitive {
/// The [`Gradient`] to apply to the mesh.
gradient: Gradient,
},
+ #[cfg(feature = "tiny_skia")]
Fill {
path: tiny_skia::Path,
paint: tiny_skia::Paint<'static>,
rule: tiny_skia::FillRule,
transform: tiny_skia::Transform,
},
+ #[cfg(feature = "tiny_skia")]
Stroke {
path: tiny_skia::Path,
paint: tiny_skia::Paint<'static>,
diff --git a/tiny_skia/Cargo.toml b/tiny_skia/Cargo.toml
index 5f39fce2..72181735 100644
--- a/tiny_skia/Cargo.toml
+++ b/tiny_skia/Cargo.toml
@@ -24,6 +24,7 @@ path = "../native"
[dependencies.iced_graphics]
version = "0.7"
path = "../graphics"
+features = ["tiny-skia"]
[dependencies.cosmic-text]
features = ["std", "swash"]
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 0840555a..69fcf899 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -265,9 +265,8 @@ impl<'a> Layer<'a> {
current_layer,
);
}
- Primitive::Fill { .. } | Primitive::Stroke { .. } => {
+ _ => {
// Unsupported!
- // TODO: Draw a placeholder (?)
}
}
}