diff options
Diffstat (limited to 'renderer/src/compositor.rs')
-rw-r--r-- | renderer/src/compositor.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/renderer/src/compositor.rs b/renderer/src/compositor.rs index 8b17a4b0..b5da31bf 100644 --- a/renderer/src/compositor.rs +++ b/renderer/src/compositor.rs @@ -46,6 +46,22 @@ impl<Theme> crate::graphics::Compositor for Compositor<Theme> { Err(error) } + fn renderer(&self) -> Self::Renderer { + match self { + Compositor::TinySkia(compositor) => { + Renderer::TinySkia(compositor.renderer()) + } + #[cfg(feature = "wgpu")] + Compositor::Wgpu(compositor) => { + Renderer::Wgpu(compositor.renderer()) + } + #[cfg(not(feature = "wgpu"))] + Self::Wgpu => { + panic!("`wgpu` feature was not enabled in `iced_renderer`") + } + } + } + fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>( &mut self, window: &W, |