summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-11-15 23:13:00 +0100
committersfan5 <sfan5@live.de>2021-11-17 22:38:34 +0100
commit9afa41945fa1110b5a6e368b0ef60472758f3000 (patch)
tree4cecdae92b891abdd1eeebda3449f1a2ca8770f5
parentda3b85b613421fadeb92936a623412629661b4e1 (diff)
downloadmpv-9afa41945fa1110b5a6e368b0ef60472758f3000.tar.bz2
mpv-9afa41945fa1110b5a6e368b0ef60472758f3000.tar.xz
context_{wayland,x11egl}: use mpegl_create_window_surface() too
Again no functional difference, just uses better APIs when they're available.
-rw-r--r--video/out/opengl/context_wayland.c8
-rw-r--r--video/out/opengl/context_x11egl.c9
2 files changed, 12 insertions, 5 deletions
diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c
index b402ca9055..e019f5fc8e 100644
--- a/video/out/opengl/context_wayland.c
+++ b/video/out/opengl/context_wayland.c
@@ -136,8 +136,12 @@ static void egl_create_window(struct ra_ctx *ctx)
p->egl_window = wl_egl_window_create(wl->surface, mp_rect_w(wl->geometry),
mp_rect_h(wl->geometry));
- p->egl_surface = eglCreateWindowSurface(p->egl_display, p->egl_config,
- p->egl_window, NULL);
+ p->egl_surface = mpegl_create_window_surface(
+ p->egl_display, p->egl_config, p->egl_window);
+ if (p->egl_surface == EGL_NO_SURFACE) {
+ p->egl_surface = eglCreateWindowSurface(
+ p->egl_display, p->egl_config, p->egl_window, NULL);
+ }
eglMakeCurrent(p->egl_display, p->egl_surface, p->egl_surface, p->egl_context);
diff --git a/video/out/opengl/context_x11egl.c b/video/out/opengl/context_x11egl.c
index 321df4039d..f1596bcee4 100644
--- a/video/out/opengl/context_x11egl.c
+++ b/video/out/opengl/context_x11egl.c
@@ -148,9 +148,12 @@ static bool mpegl_init(struct ra_ctx *ctx)
XFree(vi);
- p->egl_surface = eglCreateWindowSurface(p->egl_display, config,
- (EGLNativeWindowType)vo->x11->window, NULL);
-
+ p->egl_surface = mpegl_create_window_surface(
+ p->egl_display, config, &vo->x11->window);
+ if (p->egl_surface == EGL_NO_SURFACE) {
+ p->egl_surface = eglCreateWindowSurface(
+ p->egl_display, config, (EGLNativeWindowType)vo->x11->window, NULL);
+ }
if (p->egl_surface == EGL_NO_SURFACE) {
MP_FATAL(ctx, "Could not create EGL surface!\n");
goto uninit;