wayland: Don't pass GL config to get_egl_surface()
authorBenjamin Otte <otte@redhat.com>
Sun, 4 Jul 2021 18:55:53 +0000 (20:55 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 22 Jul 2021 14:23:56 +0000 (16:23 +0200)
There's only one GL config.

gdk/wayland/gdkglcontext-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdksurface-wayland.c
gdk/wayland/gdksurface-wayland.h

index 12a9fbe01bef5aa615b453a62390724dd443691f..3e8e8bf6f44a41ad053ff2e4b409615fd5ac2132 100644 (file)
@@ -22,7 +22,9 @@
 #include "config.h"
 
 #include "gdkglcontext-wayland.h"
+
 #include "gdkdisplay-wayland.h"
+#include "gdksurface-wayland.h"
 
 #include "gdkwaylanddisplay.h"
 #include "gdkwaylandglcontext.h"
@@ -219,8 +221,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
       if (shared == NULL)
         shared = context;
 
-      egl_surface = gdk_wayland_surface_get_egl_surface (surface,
-                                                         display_wayland->egl_config);
+      egl_surface = gdk_wayland_surface_get_egl_surface (surface);
       gdk_gl_context_make_current (shared);
       eglQuerySurface (display_wayland->egl_display, egl_surface,
                        EGL_BUFFER_AGE_EXT, &buffer_age);
@@ -270,9 +271,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
 
   gdk_gl_context_make_current (context);
 
-  egl_surface = gdk_wayland_surface_get_egl_surface (surface,
-                                                     display_wayland->egl_config);
-
+  egl_surface = gdk_wayland_surface_get_egl_surface (surface);
   gdk_wayland_surface_sync (surface);
   gdk_wayland_surface_request_frame (surface);
 
@@ -583,7 +582,7 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay   *display,
   surface = gdk_gl_context_get_surface (context);
 
   if (context_wayland->is_attached || gdk_draw_context_is_in_frame (GDK_DRAW_CONTEXT (context)))
-    egl_surface = gdk_wayland_surface_get_egl_surface (surface, display_wayland->egl_config);
+    egl_surface = gdk_wayland_surface_get_egl_surface (surface);
   else
     {
       if (display_wayland->have_egl_surfaceless_context)
index 908288e877faaeb59971d5958d5eaca5be95e92d..2177cef90d65882c59f947ab392da6aa1dfaa501 100644 (file)
@@ -182,8 +182,6 @@ cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *di
 struct wl_buffer *_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface);
 gboolean _gdk_wayland_is_shm_surface (cairo_surface_t *surface);
 
-EGLSurface gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
-                                               EGLConfig config);
 EGLSurface gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *surface,
                                                      EGLConfig config);
 
index 124bcdd1b7031005f51127895e566239e87bdea2..124b8103945b9e5fdb4ad1e558c331e146974c97 100644 (file)
@@ -4304,8 +4304,7 @@ gdk_wayland_surface_get_wl_egl_window (GdkSurface *surface)
 }
 
 EGLSurface
-gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
-                                     EGLConfig   config)
+gdk_wayland_surface_get_egl_surface (GdkSurface *surface)
 {
   GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
   GdkWaylandSurface *impl;
@@ -4320,7 +4319,7 @@ gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
       egl_window = gdk_wayland_surface_get_wl_egl_window (surface);
 
       impl->egl_surface =
-        eglCreateWindowSurface (display->egl_display, config, egl_window, NULL);
+        eglCreateWindowSurface (display->egl_display, display->egl_config, egl_window, NULL);
     }
 
   return impl->egl_surface;
index 8efa4be04dfbb9a351e89c5892e9557bf6497364..cd2b1f3e9abaa00da6314883f7765d679e52a32b 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "gdkwaylandsurface.h"
 
+#include <wayland-egl.h>
+#include <epoxy/egl.h>
+
 G_BEGIN_DECLS
 
 void                     gdk_wayland_toplevel_set_dbus_properties       (GdkToplevel *toplevel,
@@ -38,4 +41,6 @@ void                     gdk_wayland_toplevel_announce_ssd              (GdkTopl
 gboolean                 gdk_wayland_toplevel_inhibit_idle              (GdkToplevel *toplevel);
 void                     gdk_wayland_toplevel_uninhibit_idle            (GdkToplevel *toplevel);
 
+EGLSurface               gdk_wayland_surface_get_egl_surface            (GdkSurface  *surface);
+
 G_END_DECLS