diff options
| author | 2021-08-25 16:19:00 +0700 | |
|---|---|---|
| committer | 2021-08-25 16:19:00 +0700 | |
| commit | 2d65621a3b680457e689b93c800e74f726ffc175 (patch) | |
| tree | 283aaa8245b8cb41d1f4a23709ba13bbe849d4a4 /winit/src | |
| 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 '')
| -rw-r--r-- | winit/src/application.rs | 25 | 
1 files changed, 12 insertions, 13 deletions
| diff --git a/winit/src/application.rs b/winit/src/application.rs index c43eed11..b683e592 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -227,20 +227,19 @@ async fn run_instance<A, E, C>(      use iced_futures::futures::stream::StreamExt;      use winit::event; -    let surface = compositor.create_surface(&window); +    let mut surface = compositor.create_surface(&window);      let mut clipboard = Clipboard::connect(&window);      let mut state = State::new(&application, &window);      let mut viewport_version = state.viewport_version(); -    let mut swap_chain = { -        let physical_size = state.physical_size(); -        compositor.create_swap_chain( -            &surface, -            physical_size.width, -            physical_size.height, -        ) -    }; +    let physical_size = state.physical_size(); + +    compositor.configure_surface( +        &mut surface, +        physical_size.width, +        physical_size.height, +    );      let mut user_interface = ManuallyDrop::new(build_user_interface(          &mut application, @@ -358,8 +357,8 @@ async fn run_instance<A, E, C>(                          .draw(&mut renderer, state.cursor_position());                      debug.draw_finished(); -                    swap_chain = compositor.create_swap_chain( -                        &surface, +                    compositor.configure_surface( +                        &mut surface,                          physical_size.width,                          physical_size.height,                      ); @@ -369,7 +368,7 @@ async fn run_instance<A, E, C>(                  match compositor.draw(                      &mut renderer, -                    &mut swap_chain, +                    &mut surface,                      state.viewport(),                      state.background_color(),                      &primitive, @@ -393,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);                          }                          _ => { | 
