diff options
Diffstat (limited to 'graphics/src/backend.rs')
-rw-r--r-- | graphics/src/backend.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs index 10eb337f..7abc42c5 100644 --- a/graphics/src/backend.rs +++ b/graphics/src/backend.rs @@ -2,15 +2,19 @@ use crate::core::image; use crate::core::svg; use crate::core::Size; +use crate::{Compositor, Mesh, Renderer}; use std::borrow::Cow; /// The graphics backend of a [`Renderer`]. /// /// [`Renderer`]: crate::Renderer -pub trait Backend { +pub trait Backend: Sized { /// The custom kind of primitives this [`Backend`] supports. - type Primitive; + type Primitive: TryFrom<Mesh, Error = &'static str>; + + /// The default compositor of this [`Backend`]. + type Compositor: Compositor<Renderer = Renderer<Self>>; } /// A graphics backend that supports text rendering. |