Allow custom renderers in Program and Application

This commit is contained in:
Héctor Ramón Jiménez 2024-03-22 07:09:51 +01:00
parent 4f2f40c68b
commit 5137d655e6
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
19 changed files with 162 additions and 122 deletions

View file

@ -200,15 +200,12 @@ impl<L, R> graphics::Compositor for Compositor<L, R>
where
L: graphics::Compositor,
R: graphics::Compositor,
L::Settings: From<crate::Settings>,
R::Settings: From<crate::Settings>,
{
type Settings = crate::Settings;
type Renderer = Renderer<L::Renderer, R::Renderer>;
type Surface = Surface<L::Surface, R::Surface>;
async fn new<W: compositor::Window + Clone>(
settings: Self::Settings,
settings: graphics::Settings,
compatible_window: W,
) -> Result<Self, graphics::Error> {
if let Ok(left) = L::new(settings.into(), compatible_window.clone())
@ -528,3 +525,11 @@ mod geometry {
}
}
}
impl<L, R> compositor::Renderer for Renderer<L, R>
where
L: compositor::Renderer,
R: compositor::Renderer,
{
type Compositor = Compositor<L::Compositor, R::Compositor>;
}