Rename SwapChainError to SurfaceError in iced_graphics
This commit is contained in:
parent
dda032c5b8
commit
acc47a5953
4 changed files with 9 additions and 9 deletions
|
|
@ -4,7 +4,7 @@ mod compositor;
|
||||||
#[cfg(feature = "opengl")]
|
#[cfg(feature = "opengl")]
|
||||||
mod gl_compositor;
|
mod gl_compositor;
|
||||||
|
|
||||||
pub use compositor::{Compositor, SwapChainError};
|
pub use compositor::{Compositor, SurfaceError};
|
||||||
|
|
||||||
#[cfg(feature = "opengl")]
|
#[cfg(feature = "opengl")]
|
||||||
pub use gl_compositor::GLCompositor;
|
pub use gl_compositor::GLCompositor;
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,12 @@ pub trait Compositor: Sized {
|
||||||
background_color: Color,
|
background_color: Color,
|
||||||
output: &<Self::Renderer as iced_native::Renderer>::Output,
|
output: &<Self::Renderer as iced_native::Renderer>::Output,
|
||||||
overlay: &[T],
|
overlay: &[T],
|
||||||
) -> Result<mouse::Interaction, SwapChainError>;
|
) -> Result<mouse::Interaction, SurfaceError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Result of an unsuccessful call to [`Compositor::draw`].
|
/// Result of an unsuccessful call to [`Compositor::draw`].
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Error)]
|
#[derive(Clone, PartialEq, Eq, Debug, Error)]
|
||||||
pub enum SwapChainError {
|
pub enum SurfaceError {
|
||||||
/// A timeout was encountered while trying to acquire the next frame.
|
/// A timeout was encountered while trying to acquire the next frame.
|
||||||
#[error(
|
#[error(
|
||||||
"A timeout was encountered while trying to acquire the next frame"
|
"A timeout was encountered while trying to acquire the next frame"
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ impl iced_graphics::window::Compositor for Compositor {
|
||||||
background_color: Color,
|
background_color: Color,
|
||||||
output: &<Self::Renderer as iced_native::Renderer>::Output,
|
output: &<Self::Renderer as iced_native::Renderer>::Output,
|
||||||
overlay: &[T],
|
overlay: &[T],
|
||||||
) -> Result<mouse::Interaction, iced_graphics::window::SwapChainError> {
|
) -> Result<mouse::Interaction, iced_graphics::window::SurfaceError> {
|
||||||
match surface.get_current_frame() {
|
match surface.get_current_frame() {
|
||||||
Ok(frame) => {
|
Ok(frame) => {
|
||||||
let mut encoder = self.device.create_command_encoder(
|
let mut encoder = self.device.create_command_encoder(
|
||||||
|
|
@ -206,16 +206,16 @@ impl iced_graphics::window::Compositor for Compositor {
|
||||||
}
|
}
|
||||||
Err(error) => match error {
|
Err(error) => match error {
|
||||||
wgpu::SurfaceError::Timeout => {
|
wgpu::SurfaceError::Timeout => {
|
||||||
Err(iced_graphics::window::SwapChainError::Timeout)
|
Err(iced_graphics::window::SurfaceError::Timeout)
|
||||||
}
|
}
|
||||||
wgpu::SurfaceError::Outdated => {
|
wgpu::SurfaceError::Outdated => {
|
||||||
Err(iced_graphics::window::SwapChainError::Outdated)
|
Err(iced_graphics::window::SurfaceError::Outdated)
|
||||||
}
|
}
|
||||||
wgpu::SurfaceError::Lost => {
|
wgpu::SurfaceError::Lost => {
|
||||||
Err(iced_graphics::window::SwapChainError::Lost)
|
Err(iced_graphics::window::SurfaceError::Lost)
|
||||||
}
|
}
|
||||||
wgpu::SurfaceError::OutOfMemory => {
|
wgpu::SurfaceError::OutOfMemory => {
|
||||||
Err(iced_graphics::window::SwapChainError::OutOfMemory)
|
Err(iced_graphics::window::SurfaceError::OutOfMemory)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ async fn run_instance<A, E, C>(
|
||||||
}
|
}
|
||||||
Err(error) => match error {
|
Err(error) => match error {
|
||||||
// This is an unrecoverable error.
|
// This is an unrecoverable error.
|
||||||
window::SwapChainError::OutOfMemory => {
|
window::SurfaceError::OutOfMemory => {
|
||||||
panic!("{}", error);
|
panic!("{}", error);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue