summaryrefslogtreecommitdiffstats
path: root/wgpu/src/primitive.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-07 23:45:54 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-07 23:45:54 +0100
commitb74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68 (patch)
treed05e074ad1a57309ae1ed09f49fee1cbb78a6ea6 /wgpu/src/primitive.rs
parent37f0d97159d81dbd4801e287a06f4e243e483269 (diff)
downloadiced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.tar.gz
iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.tar.bz2
iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.zip
Implement `Primitive::Cached`
Diffstat (limited to '')
-rw-r--r--wgpu/src/primitive.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs
index 823b4b72..46d9e624 100644
--- a/wgpu/src/primitive.rs
+++ b/wgpu/src/primitive.rs
@@ -78,7 +78,18 @@ pub enum Primitive {
origin: Point,
/// The vertex and index buffers of the mesh
- buffers: Arc<triangle::Mesh2D>,
+ buffers: triangle::Mesh2D,
+ },
+ /// A cached primitive.
+ ///
+ /// This can be useful if you are implementing a widget where primitive
+ /// generation is expensive.
+ Cached {
+ /// The origin of the coordinate system of the cached primitives
+ origin: Point,
+
+ /// The cached primitive
+ cache: Arc<Primitive>,
},
}