@@ -84,23 +84,6 @@ impl SurfaceConfig {
8484 . collect ( ) ,
8585 } ;
8686 }
87-
88- pub ( crate ) fn to_wgpu ( & self ) -> wgpu:: SurfaceConfiguration {
89- let mut view_formats: Vec < wgpu:: TextureFormat > = Vec :: new ( ) ;
90- for vf in & self . view_formats {
91- view_formats. push ( vf. to_wgpu ( ) ) ;
92- }
93- return wgpu:: SurfaceConfiguration {
94- usage : self . usage . to_wgpu ( ) ,
95- format : self . format . to_wgpu ( ) ,
96- width : self . width ,
97- height : self . height ,
98- present_mode : self . present_mode . to_wgpu ( ) ,
99- desired_maximum_frame_latency : 2 ,
100- alpha_mode : wgpu:: CompositeAlphaMode :: Opaque ,
101- view_formats,
102- } ;
103- }
10487}
10588
10689/// Error wrapper for surface acquisition and presentation errors.
@@ -154,10 +137,10 @@ impl SurfaceBuilder {
154137 /// Safety: we use `create_surface_unsafe` by forwarding raw window/display
155138 /// handles from `winit`. Lambda guarantees the window outlives the surface
156139 /// for the duration of the runtime.
157- pub fn build < ' window > (
140+ pub fn build (
158141 self ,
159142 instance : & Instance ,
160- window : & ' window WindowHandle ,
143+ window : & WindowHandle ,
161144 ) -> Result < Surface < ' static > , CreateSurfaceError > {
162145 // SAFETY: We ensure the raw window/display handles outlive the surface by
163146 // keeping the window alive for the duration of the application runtime.
@@ -192,6 +175,12 @@ impl SurfaceBuilder {
192175 }
193176}
194177
178+ impl Default for SurfaceBuilder {
179+ fn default ( ) -> Self {
180+ return Self :: new ( ) ;
181+ }
182+ }
183+
195184/// Opaque error returned when surface creation fails.
196185#[ derive( Debug ) ]
197186pub struct CreateSurfaceError ;
@@ -351,11 +340,6 @@ impl Frame {
351340 return TextureViewRef { raw : & self . view } ;
352341 }
353342
354- /// Consume and return the underlying parts.
355- pub ( crate ) fn into_parts ( self ) -> ( wgpu:: SurfaceTexture , wgpu:: TextureView ) {
356- return ( self . texture , self . view ) ;
357- }
358-
359343 /// Present the frame to the swapchain.
360344 pub fn present ( self ) {
361345 self . texture . present ( ) ;
0 commit comments