File tree Expand file tree Collapse file tree 1 file changed +23
-23
lines changed Expand file tree Collapse file tree 1 file changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -185,30 +185,30 @@ pub fn present(
185185 } )
186186 . unwrap_or_else ( || vec ! [ Rectangle :: with_size( viewport. logical_size( ) ) ] ) ;
187187
188- if damage. is_empty ( ) {
189- return Ok ( ( ) ) ;
190- }
191-
192- surface. layer_stack . push_front ( renderer. layers ( ) . to_vec ( ) ) ;
193- surface. background_color = background_color;
194-
195- let damage =
196- damage:: group ( damage, Rectangle :: with_size ( viewport. logical_size ( ) ) ) ;
197-
198- let mut pixels = tiny_skia:: PixmapMut :: from_bytes (
199- bytemuck:: cast_slice_mut ( & mut buffer) ,
200- physical_size. width ,
201- physical_size. height ,
202- )
203- . expect ( "Create pixel map" ) ;
188+ if !damage. is_empty ( ) {
189+ surface. layer_stack . push_front ( renderer. layers ( ) . to_vec ( ) ) ;
190+ surface. background_color = background_color;
191+
192+ let damage = damage:: group (
193+ damage,
194+ Rectangle :: with_size ( viewport. logical_size ( ) ) ,
195+ ) ;
196+
197+ let mut pixels = tiny_skia:: PixmapMut :: from_bytes (
198+ bytemuck:: cast_slice_mut ( & mut buffer) ,
199+ physical_size. width ,
200+ physical_size. height ,
201+ )
202+ . expect ( "Create pixel map" ) ;
204203
205- renderer. draw (
206- & mut pixels,
207- & mut surface. clip_mask ,
208- viewport,
209- & damage,
210- background_color,
211- ) ;
204+ renderer. draw (
205+ & mut pixels,
206+ & mut surface. clip_mask ,
207+ viewport,
208+ & damage,
209+ background_color,
210+ ) ;
211+ }
212212
213213 on_pre_present ( ) ;
214214 buffer. present ( ) . map_err ( |_| compositor:: SurfaceError :: Lost )
You can’t perform that action at this time.
0 commit comments