Remove Layer trait and simplify Canvas
This commit is contained in:
parent
bb424e54c5
commit
592cc68506
9 changed files with 181 additions and 174 deletions
15
wgpu/src/widget/canvas/geometry.rs
Normal file
15
wgpu/src/widget/canvas/geometry.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use crate::Primitive;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Geometry(Arc<Primitive>);
|
||||
|
||||
impl Geometry {
|
||||
pub(crate) fn from_primitive(primitive: Arc<Primitive>) -> Self {
|
||||
Self(primitive)
|
||||
}
|
||||
|
||||
pub(crate) fn into_primitive(self) -> Arc<Primitive> {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue