[gtk/wip.win32.fixes: 16/18] GDK-Win32: Drop GDK_WIN32_ENABLE_EGL flag
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip.win32.fixes: 16/18] GDK-Win32: Drop GDK_WIN32_ENABLE_EGL flag
- Date: Thu, 7 Oct 2021 15:01:49 +0000 (UTC)
commit b587ccf7e4d14c0f1d7f757dbf3beb0a4c1e6446
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Oct 7 15:26:49 2021 +0800
GDK-Win32: Drop GDK_WIN32_ENABLE_EGL flag
Instead, use HAVE_EGL check macro instead, which is used by the other
platforms as well.
gdk/win32/gdkdisplay-win32.c | 12 ++++++------
gdk/win32/gdkdisplay-win32.h | 6 +++---
gdk/win32/gdkglcontext-win32.c | 2 +-
gdk/win32/gdkglcontext-win32.h | 2 +-
gdk/win32/gdksurface-win32.c | 6 +++---
gdk/win32/gdksurface-win32.h | 6 +++---
gdk/win32/meson.build | 5 +----
7 files changed, 18 insertions(+), 21 deletions(-)
---
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 5495f0f6af..e89e35bb14 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -38,7 +38,7 @@
#include <dwmapi.h>
#include "gdkwin32langnotification.h"
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
# include <epoxy/egl.h>
#endif
@@ -645,7 +645,7 @@ gdk_win32_display_dispose (GObject *object)
{
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (object);
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
if (display_win32->egl_disp != EGL_NO_DISPLAY)
{
eglTerminate (display_win32->egl_disp);
@@ -1158,7 +1158,7 @@ gdk_win32_display_init_gl_backend (GdkDisplay *display,
result = gdk_win32_display_init_wgl (display, error);
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
if (!result)
{
g_clear_error (error);
@@ -1179,7 +1179,7 @@ gdk_win32_display_init_gl (GdkDisplay *display,
if (!gdk_win32_display_init_gl_backend (display, error))
return NULL;
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
if (display_win32->egl_disp)
gl_context = g_object_new (GDK_TYPE_WIN32_GL_CONTEXT_EGL, "display", display, NULL);
else
@@ -1203,13 +1203,13 @@ gdk_win32_display_init_gl (GdkDisplay *display,
gpointer
gdk_win32_display_get_egl_display (GdkDisplay *display)
{
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
GdkWin32Display *display_win32;
#endif
g_return_val_if_fail (GDK_IS_WIN32_DISPLAY (display), NULL);
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
display_win32 = GDK_WIN32_DISPLAY (display);
if (display_win32->wgl_pixel_format != 0)
diff --git a/gdk/win32/gdkdisplay-win32.h b/gdk/win32/gdkdisplay-win32.h
index f9885e72e2..d8d3d121e6 100644
--- a/gdk/win32/gdkdisplay-win32.h
+++ b/gdk/win32/gdkdisplay-win32.h
@@ -25,7 +25,7 @@
#include "gdkwin32screen.h"
#include "gdkwin32cursor.h"
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
# include <epoxy/egl.h>
#endif
@@ -135,7 +135,7 @@ struct _GdkWin32Display
int wgl_pixel_format;
guint gl_version;
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
/* EGL (Angle) Items */
guint egl_version;
EGLDisplay egl_disp;
@@ -151,7 +151,7 @@ struct _GdkWin32Display
guint hasWglARBPixelFormat : 1;
guint hasWglARBmultisample : 1;
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
guint hasEglKHRCreateContext : 1;
guint hasEglSurfacelessContext : 1;
EGLint egl_min_swap_interval;
diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c
index ec5c51789f..c1126318ca 100644
--- a/gdk/win32/gdkglcontext-win32.c
+++ b/gdk/win32/gdkglcontext-win32.c
@@ -40,7 +40,7 @@
#include <cairo.h>
#include <epoxy/wgl.h>
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
# include <epoxy/egl.h>
#endif
diff --git a/gdk/win32/gdkglcontext-win32.h b/gdk/win32/gdkglcontext-win32.h
index 5bb122d16e..77995671ce 100644
--- a/gdk/win32/gdkglcontext-win32.h
+++ b/gdk/win32/gdkglcontext-win32.h
@@ -24,7 +24,7 @@
#include <epoxy/gl.h>
#include <epoxy/wgl.h>
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
# include <epoxy/egl.h>
#endif
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index d31101e414..72a794beab 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -689,7 +689,7 @@ gdk_win32_surface_destroy (GdkSurface *window,
gdk_win32_surface_set_transient_for (child, NULL);
}
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_surface_get_display (window));
/* Get rid of any EGLSurfaces that we might have created */
@@ -5099,7 +5099,7 @@ gdk_win32_drag_surface_iface_init (GdkDragSurfaceInterface *iface)
iface->present = gdk_win32_drag_surface_present;
}
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
EGLSurface
gdk_win32_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config,
@@ -5216,7 +5216,7 @@ _gdk_win32_surface_invalidate_egl_framebuffer (GdkSurface *surface)
* as we need to re-acquire the EGL surfaces that we rendered to upload to Cairo explicitly,
* using gdk_window_invalidate_rect (), when we maximize or restore or use aerosnap
*/
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
if (surface->gl_paint_context != NULL && gdk_gl_context_get_use_es (surface->gl_paint_context))
{
GdkWin32Surface *impl = GDK_WIN32_SURFACE (surface);
diff --git a/gdk/win32/gdksurface-win32.h b/gdk/win32/gdksurface-win32.h
index 53a2fbcefd..9d5e121879 100644
--- a/gdk/win32/gdksurface-win32.h
+++ b/gdk/win32/gdksurface-win32.h
@@ -33,7 +33,7 @@
#include <windows.h>
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
# include <epoxy/egl.h>
#endif
@@ -339,7 +339,7 @@ struct _GdkWin32Surface
} next_layout;
gboolean force_recompute_size;
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
EGLSurface egl_surface;
EGLSurface egl_dummy_surface;
guint egl_force_redraw_all : 1;
@@ -374,7 +374,7 @@ void gdk_win32_surface_move_resize (GdkSurface *window,
RECT
gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context);
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
EGLSurface gdk_win32_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config,
gboolean is_dummy);
diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build
index 0177adaf83..0f40e73edc 100644
--- a/gdk/win32/meson.build
+++ b/gdk/win32/meson.build
@@ -46,10 +46,7 @@ gdk_win32_public_headers = files([
install_headers(gdk_win32_public_headers, 'gdkwin32.h', subdir: 'gtk-4.0/gdk/win32/')
-GDK_WIN32_EGL_CFLAGS = []
-
if have_egl
- GDK_WIN32_EGL_CFLAGS = ['-DGDK_WIN32_ENABLE_EGL']
gdk_win32_sources += ['gdkglcontext-win32-egl.c']
endif
@@ -67,6 +64,6 @@ libgdk_win32 = static_library('gdk-win32',
'-DINSIDE_GDK_WIN32',
'-D_WIN32_WINNT=0x0601',
'-DWINVER=0x0601',
- ] + GDK_WIN32_EGL_CFLAGS,
+ ],
dependencies: [ gdk_deps, gdk_win32_deps ],
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]