[gtk/master.win32: 1/3] gskrenderer.c: Default to the GL renderer on Windows too




commit 73c640aa5d940c54c593983664982c87b8f51400
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jul 31 18:44:10 2020 +0800

    gskrenderer.c: Default to the GL renderer on Windows too
    
    Since we have now made the Win32 GL contexts share the global context as
    the other backends have, we are more ready to use the GL renderer by
    default on Windows as well.
    
    Note that currently we can only enable this when not running on
    OpenGL/ES as the OpenGL/ES shaders are not ready at this point, and the
    OpenGL/ES support that we have from libANGLE does not support full
    desktop OpenGL operations.

 gsk/gskrenderer.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index 5f4b1deeb8..5b7756e613 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -63,6 +63,13 @@
 #ifdef GDK_WINDOWING_MACOS
 #include <gdk/macos/gdkmacos.h>
 #endif
+#ifdef GDK_WINDOWING_WIN32
+#include <gdk/win32/gdkwin32.h>
+
+/* Remove these lines when OpenGL/ES 2.0 shader is ready */
+#include "win32/gdkprivate-win32.h"
+#include "win32/gdkdisplay-win32.h"
+#endif
 
 typedef struct
 {
@@ -562,6 +569,17 @@ get_renderer_for_backend (GdkSurface *surface)
   if (GDK_IS_MACOS_SURFACE (surface))
     return GSK_TYPE_GL_RENDERER;
 #endif
+#ifdef GDK_WINDOWING_WIN32
+  if (GDK_IS_WIN32_SURFACE (surface))
+    /* remove check for OpenGL/ES when OpenGL/ES 2.0 shader is ready */
+    {
+      GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_surface_get_display (surface));
+
+      if (!(GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) ||
+            display->running_on_arm64))
+        return GSK_TYPE_GL_RENDERER;
+    }
+#endif
 
   return G_TYPE_INVALID;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]