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.
This commit is contained in:
Chun-wei Fan 2020-07-31 18:44:10 +08:00
parent 85706dc39d
commit d6955d4427

View File

@ -63,6 +63,13 @@
#ifdef GDK_WINDOWING_MACOS #ifdef GDK_WINDOWING_MACOS
#include <gdk/macos/gdkmacos.h> #include <gdk/macos/gdkmacos.h>
#endif #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 typedef struct
{ {
@ -562,6 +569,17 @@ get_renderer_for_backend (GdkSurface *surface)
if (GDK_IS_MACOS_SURFACE (surface)) if (GDK_IS_MACOS_SURFACE (surface))
return GSK_TYPE_GL_RENDERER; return GSK_TYPE_GL_RENDERER;
#endif #endif
#ifdef GDK_WINDOWING_WIN32
if (GDK_IS_WIN32_SURFACE (surface))
/* remove check for OpenGL/ES when OpenGL/ES 2.0 shader is ready */
{
GdkDisplay *display = gdk_surface_get_display (surface);
if (!(GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) ||
GDK_WIN32_DISPLAY (display)->running_on_arm64))
return GSK_TYPE_GL_RENDERER;
}
#endif
return G_TYPE_INVALID; return G_TYPE_INVALID;
} }