diff options
author | 2021-08-25 16:19:00 +0700 | |
---|---|---|
committer | 2021-08-25 16:19:00 +0700 | |
commit | 2d65621a3b680457e689b93c800e74f726ffc175 (patch) | |
tree | 283aaa8245b8cb41d1f4a23709ba13bbe849d4a4 /graphics | |
parent | 8333b8f88ceaa53c361eb6726b2b7dac6cd2c402 (diff) | |
parent | acc47a595300ff9bb9cae1e26c2d41135cde8ae8 (diff) | |
download | iced-2d65621a3b680457e689b93c800e74f726ffc175.tar.gz iced-2d65621a3b680457e689b93c800e74f726ffc175.tar.bz2 iced-2d65621a3b680457e689b93c800e74f726ffc175.zip |
Merge pull request #1000 from PolyMeilex/wgpu-0.10
wgpu: Update to 0.10
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/src/window.rs | 2 | ||||
-rw-r--r-- | graphics/src/window/compositor.rs | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/graphics/src/window.rs b/graphics/src/window.rs index 365ddfbc..67ec3322 100644 --- a/graphics/src/window.rs +++ b/graphics/src/window.rs @@ -4,7 +4,7 @@ mod compositor; #[cfg(feature = "opengl")] mod gl_compositor; -pub use compositor::{Compositor, SwapChainError}; +pub use compositor::{Compositor, SurfaceError}; #[cfg(feature = "opengl")] pub use gl_compositor::GLCompositor; diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index de2a6990..37edef1d 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -16,9 +16,6 @@ pub trait Compositor: Sized { /// The surface of the backend. type Surface; - /// The swap chain of the backend. - type SwapChain; - /// Creates a new [`Compositor`]. fn new<W: HasRawWindowHandle>( settings: Self::Settings, @@ -37,12 +34,12 @@ pub trait Compositor: Sized { /// /// [`SwapChain`]: Self::SwapChain /// [`Surface`]: Self::Surface - fn create_swap_chain( + fn configure_surface( &mut self, - surface: &Self::Surface, + surface: &mut Self::Surface, width: u32, height: u32, - ) -> Self::SwapChain; + ); /// Draws the output primitives to the next frame of the given [`SwapChain`]. /// @@ -50,17 +47,17 @@ pub trait Compositor: Sized { fn draw<T: AsRef<str>>( &mut self, renderer: &mut Self::Renderer, - swap_chain: &mut Self::SwapChain, + surface: &mut Self::Surface, viewport: &Viewport, background_color: Color, output: &<Self::Renderer as iced_native::Renderer>::Output, overlay: &[T], - ) -> Result<mouse::Interaction, SwapChainError>; + ) -> Result<mouse::Interaction, SurfaceError>; } /// Result of an unsuccessful call to [`Compositor::draw`]. #[derive(Clone, PartialEq, Eq, Debug, Error)] -pub enum SwapChainError { +pub enum SurfaceError { /// A timeout was encountered while trying to acquire the next frame. #[error( "A timeout was encountered while trying to acquire the next frame" |