Rename compositor::Renderer to Default
This commit is contained in:
parent
a2c897792c
commit
441e9237cd
9 changed files with 26 additions and 21 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 = ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<B> compositor::Renderer for Renderer<B>
|
||||
impl<B> compositor::Default for Renderer<B>
|
||||
where
|
||||
B: Backend,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue