Rename compositor::Renderer to Default

This commit is contained in:
Héctor Ramón Jiménez 2024-03-22 19:35:19 +01:00
parent a2c897792c
commit 441e9237cd
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
9 changed files with 26 additions and 21 deletions

View file

@ -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.

View file

@ -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 = ();
}

View file

@ -261,7 +261,7 @@ where
}
}
impl<B> compositor::Renderer for Renderer<B>
impl<B> compositor::Default for Renderer<B>
where
B: Backend,
{