summaryrefslogtreecommitdiffstats
path: root/wgpu/src/widget/canvas/geometry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/widget/canvas/geometry.rs')
-rw-r--r--wgpu/src/widget/canvas/geometry.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/wgpu/src/widget/canvas/geometry.rs b/wgpu/src/widget/canvas/geometry.rs
index 12ef828f..4cadee39 100644
--- a/wgpu/src/widget/canvas/geometry.rs
+++ b/wgpu/src/widget/canvas/geometry.rs
@@ -1,5 +1,13 @@
use crate::Primitive;
+/// A bunch of shapes that can be drawn.
+///
+/// [`Geometry`] can be easily generated with a [`Frame`] or stored in a
+/// [`Cache`].
+///
+/// [`Geometry`]: struct.Geometry.html
+/// [`Frame`]: struct.Frame.html
+/// [`Cache`]: struct.Cache.html
#[derive(Debug, Clone)]
pub struct Geometry(Primitive);
@@ -8,6 +16,12 @@ impl Geometry {
Self(primitive)
}
+ /// Turns the [`Geometry`] into a [`Primitive`].
+ ///
+ /// This can be useful if you are building a custom widget.
+ ///
+ /// [`Geometry`]: struct.Geometry.html
+ /// [`Primitive`]: ../enum.Primitive.html
pub fn into_primitive(self) -> Primitive {
self.0
}