[gtk/wip/ebassi/gdk-egl-x11-v2: 6/7] gdk/x11: Force GLES when using EGL X11
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/gdk-egl-x11-v2: 6/7] gdk/x11: Force GLES when using EGL X11
- Date: Thu, 18 Jul 2019 18:12:38 +0000 (UTC)
commit 622ac52f35e1695be62040d6c11011107efb8812
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Dec 14 12:55:22 2016 +0000
gdk/x11: Force GLES when using EGL X11
This is necessary on certain embedded devices, to avoid going through
the wrong API.
gdk/x11/gdkglcontext-x11-eglx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11-eglx.c b/gdk/x11/gdkglcontext-x11-eglx.c
index ff91fe3f85..ad9b61378a 100644
--- a/gdk/x11/gdkglcontext-x11-eglx.c
+++ b/gdk/x11/gdkglcontext-x11-eglx.c
@@ -446,13 +446,14 @@ gdk_x11_gl_context_realize (GdkGLContext *context,
legacy_bit = !display_x11->has_create_context ||
(_gdk_gl_flags & GDK_GL_LEGACY) != 0;
- es_bit = ((_gdk_gl_flags & GDK_GL_GLES) != 0 ||
- (share != NULL && gdk_gl_context_get_use_es (share)));
+ /* XXX: Force GLES */
+ es_bit = TRUE;
if (es_bit)
{
+ /* XXX: Force GLES 2.0 */
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
- context_attrs[1] = major == 3 ? 3 : 2;
+ context_attrs[1] = 2;
context_attrs[2] = EGL_NONE;
eglBindAPI (EGL_OPENGL_ES_API);
@@ -490,7 +491,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context,
GDK_NOTE (OPENGL,
g_message ("Creating EGL context (version:%d.%d, debug:%s, forward:%s, legacy:%s, es:%s)",
- major, minor,
+ 2, 0,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy_bit ? "yes" : "no",
@@ -606,7 +607,7 @@ gdk_x11_display_init_gl (GdkDisplay *display)
if (!eglInitialize (edpy, &major, &minor))
return FALSE;
- if (!eglBindAPI (EGL_OPENGL_API))
+ if (!eglBindAPI (EGL_OPENGL_ES_API))
return FALSE;
display_x11->supports_gl = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]