Skip to content

Commit

Permalink
video/wayland: use EGL_EXT_present_opaque when available
Browse files Browse the repository at this point in the history
  • Loading branch information
1ace committed Aug 2, 2021
1 parent 1fb1aa1 commit 6050003
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/video/SDL_egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
#endif
#endif /* EGL_KHR_create_context */

//debug only, will be dropped by the time this is merged
#ifndef EGL_EXT_present_opaque
#define EGL_EXT_present_opaque 1
#define EGL_PRESENT_OPAQUE_EXT 0x31DF
#endif /* EGL_EXT_protected_content */

#if SDL_VIDEO_DRIVER_RPI
/* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
#define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "libbrcmEGL.so" )
Expand Down Expand Up @@ -1182,8 +1188,8 @@ SDL_EGL_CreateSurface(_THIS, NativeWindowType nw)
EGLint format_wanted;
EGLint format_got;
#endif
/* max 2 values plus terminator. */
EGLint attribs[3];
/* max 2 key+value pairs, plus terminator. */
EGLint attribs[5];
int attr = 0;

EGLSurface * surface;
Expand Down Expand Up @@ -1216,6 +1222,13 @@ SDL_EGL_CreateSurface(_THIS, NativeWindowType nw)
}
}

#ifdef EGL_EXT_present_opaque
if (SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_EXT_present_opaque")) {
attribs[attr++] = EGL_PRESENT_OPAQUE_EXT;
attribs[attr++] = EGL_TRUE;
}
#endif

attribs[attr++] = EGL_NONE;

surface = _this->egl_data->eglCreateWindowSurface(
Expand Down

0 comments on commit 6050003

Please sign in to comment.