diff options
Diffstat (limited to '')
-rw-r--r-- | graphics/src/backend.rs | 6 | ||||
-rw-r--r-- | graphics/src/compositor.rs | 7 | ||||
-rw-r--r-- | graphics/src/renderer.rs | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs index aa7bf4e8..7abc42c5 100644 --- a/graphics/src/backend.rs +++ b/graphics/src/backend.rs @@ -10,11 +10,11 @@ use std::borrow::Cow; /// /// [`Renderer`]: crate::Renderer pub trait Backend: Sized { - /// The compositor of this [`Backend`]. - type Compositor: Compositor<Renderer = Renderer<Self>>; - /// The custom kind of primitives this [`Backend`] supports. 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. diff --git a/graphics/src/compositor.rs b/graphics/src/compositor.rs index 4d548f30..8c67cd16 100644 --- a/graphics/src/compositor.rs +++ b/graphics/src/compositor.rs @@ -1,6 +1,5 @@ //! A compositor is responsible for initializing a renderer and managing window //! surfaces. -use crate::core; use crate::core::Color; use crate::futures::{MaybeSend, MaybeSync}; use crate::{Error, Settings, Viewport}; @@ -90,8 +89,8 @@ impl<T> Window for T where { } -/// A renderer that supports composition. -pub trait Renderer: core::Renderer { +/// Defines the default compositor of a renderer. +pub trait Default { /// The compositor of the renderer. type Compositor: Compositor<Renderer = Self>; } @@ -187,6 +186,6 @@ impl Compositor for () { } #[cfg(debug_assertions)] -impl Renderer for () { +impl Default for () { type Compositor = (); } diff --git a/graphics/src/renderer.rs b/graphics/src/renderer.rs index 5de7f97f..f517ff3e 100644 --- a/graphics/src/renderer.rs +++ b/graphics/src/renderer.rs @@ -261,7 +261,7 @@ where } } -impl<B> compositor::Renderer for Renderer<B> +impl<B> compositor::Default for Renderer<B> where B: Backend, { |