diff options
author | 2021-08-25 15:42:35 +0700 | |
---|---|---|
committer | 2021-08-25 15:42:35 +0700 | |
commit | acc47a595300ff9bb9cae1e26c2d41135cde8ae8 (patch) | |
tree | 3880f5aeae3fc2a44d0022db4895bea217936ba2 | |
parent | dda032c5b82c8dbc818e7bb6b0262644a4008995 (diff) | |
download | iced-acc47a595300ff9bb9cae1e26c2d41135cde8ae8.tar.gz iced-acc47a595300ff9bb9cae1e26c2d41135cde8ae8.tar.bz2 iced-acc47a595300ff9bb9cae1e26c2d41135cde8ae8.zip |
Rename `SwapChainError` to `SurfaceError` in `iced_graphics`
-rw-r--r-- | graphics/src/window.rs | 2 | ||||
-rw-r--r-- | graphics/src/window/compositor.rs | 4 | ||||
-rw-r--r-- | wgpu/src/window/compositor.rs | 10 | ||||
-rw-r--r-- | winit/src/application.rs | 2 |
4 files changed, 9 insertions, 9 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 0cf11f31..37edef1d 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -52,12 +52,12 @@ pub trait Compositor: Sized { 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" diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index bba594ce..eca54b6f 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -140,7 +140,7 @@ impl iced_graphics::window::Compositor for Compositor { background_color: Color, output: &<Self::Renderer as iced_native::Renderer>::Output, overlay: &[T], - ) -> Result<mouse::Interaction, iced_graphics::window::SwapChainError> { + ) -> Result<mouse::Interaction, iced_graphics::window::SurfaceError> { match surface.get_current_frame() { Ok(frame) => { let mut encoder = self.device.create_command_encoder( @@ -206,16 +206,16 @@ impl iced_graphics::window::Compositor for Compositor { } Err(error) => match error { wgpu::SurfaceError::Timeout => { - Err(iced_graphics::window::SwapChainError::Timeout) + Err(iced_graphics::window::SurfaceError::Timeout) } wgpu::SurfaceError::Outdated => { - Err(iced_graphics::window::SwapChainError::Outdated) + Err(iced_graphics::window::SurfaceError::Outdated) } wgpu::SurfaceError::Lost => { - Err(iced_graphics::window::SwapChainError::Lost) + Err(iced_graphics::window::SurfaceError::Lost) } wgpu::SurfaceError::OutOfMemory => { - Err(iced_graphics::window::SwapChainError::OutOfMemory) + Err(iced_graphics::window::SurfaceError::OutOfMemory) } }, } diff --git a/winit/src/application.rs b/winit/src/application.rs index 9a86644c..b683e592 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -392,7 +392,7 @@ async fn run_instance<A, E, C>( } Err(error) => match error { // This is an unrecoverable error. - window::SwapChainError::OutOfMemory => { + window::SurfaceError::OutOfMemory => { panic!("{}", error); } _ => { |