File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
src/backend/renderer/gles Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -797,6 +797,18 @@ impl GlesRenderer {
797
797
pub fn capabilities ( & self ) -> & [ Capability ] {
798
798
& self . capabilities
799
799
}
800
+
801
+ fn export_sync_point ( & self ) -> Option < SyncPoint > {
802
+ if self . capabilities . contains ( & Capability :: ExportFence ) {
803
+ if let Ok ( fence) = EGLFence :: create ( self . egl . display ( ) ) {
804
+ unsafe {
805
+ self . gl . Flush ( ) ;
806
+ }
807
+ return Some ( SyncPoint :: from ( fence) ) ;
808
+ }
809
+ }
810
+ None
811
+ }
800
812
}
801
813
802
814
#[ cfg( feature = "wayland_frontend" ) ]
@@ -2368,13 +2380,8 @@ impl GlesFrame<'_, '_> {
2368
2380
self . renderer . cleanup ( ) ;
2369
2381
2370
2382
// if we support egl fences we should use it
2371
- if self . renderer . capabilities . contains ( & Capability :: ExportFence ) {
2372
- if let Ok ( fence) = EGLFence :: create ( self . renderer . egl . display ( ) ) {
2373
- unsafe {
2374
- self . renderer . gl . Flush ( ) ;
2375
- }
2376
- return Ok ( SyncPoint :: from ( fence) ) ;
2377
- }
2383
+ if let Some ( sync_point) = self . renderer . export_sync_point ( ) {
2384
+ return Ok ( sync_point) ;
2378
2385
}
2379
2386
2380
2387
// as a last option we force finish, this is unlikely to happen
You can’t perform that action at this time.
0 commit comments