Implement Primitive::Cached
This commit is contained in:
parent
37f0d97159
commit
b74e7e7353
12 changed files with 151 additions and 105 deletions
|
|
@ -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>,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue