diff options
author | 2020-03-07 23:45:54 +0100 | |
---|---|---|
committer | 2020-03-07 23:45:54 +0100 | |
commit | b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68 (patch) | |
tree | d05e074ad1a57309ae1ed09f49fee1cbb78a6ea6 /wgpu/src/primitive.rs | |
parent | 37f0d97159d81dbd4801e287a06f4e243e483269 (diff) | |
download | iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.tar.gz iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.tar.bz2 iced-b74e7e7353d69ffb54cf0c0f0574ea7abf0f3a68.zip |
Implement `Primitive::Cached`
Diffstat (limited to 'wgpu/src/primitive.rs')
-rw-r--r-- | wgpu/src/primitive.rs | 13 |
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>, }, } |