summaryrefslogtreecommitdiff
path: root/cogl
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-09-23 11:49:10 +0800
committerJonas Ådahl <jadahl@gmail.com>2017-03-25 00:17:18 +0800
commitac813d528558068de8efd04d0f30721dd10d6632 (patch)
tree5ea75aa459f0716c1e068da09c458883a60bcee0 /cogl
parent5d3e7d6ffd1faee0ba6385719e7cf29ccfcd5211 (diff)
downloadmutter-ac813d528558068de8efd04d0f30721dd10d6632.tar.gz
x11: Use EGL instead of GLX when drawing using GLES
When running as a X11 CM we shouldn't use the GLX winsys when the driver doesn't support it, i.e. OpenGL ES drivers. https://bugzilla.gnome.org/show_bug.cgi?id=771636
Diffstat (limited to 'cogl')
-rw-r--r--cogl/cogl/cogl-mutter.h4
-rw-r--r--cogl/cogl/cogl-renderer-private.h5
-rw-r--r--cogl/cogl/cogl-renderer.c7
3 files changed, 9 insertions, 7 deletions
diff --git a/cogl/cogl/cogl-mutter.h b/cogl/cogl/cogl-mutter.h
index 4bfac07fa..a1cd7e301 100644
--- a/cogl/cogl/cogl-mutter.h
+++ b/cogl/cogl/cogl-mutter.h
@@ -42,7 +42,7 @@
#include <cogl/winsys/cogl-winsys-egl-private.h>
#include <cogl/winsys/cogl-winsys-private.h>
-void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
- CoglWinsysVtableGetter winsys_vtable_getter);
+void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
+ CoglCustomWinsysVtableGetter winsys_vtable_getter);
#endif /* __COGL_MUTTER_H___ */
diff --git a/cogl/cogl/cogl-renderer-private.h b/cogl/cogl/cogl-renderer-private.h
index 33ed0ceac..a833a6819 100644
--- a/cogl/cogl/cogl-renderer-private.h
+++ b/cogl/cogl/cogl-renderer-private.h
@@ -39,12 +39,13 @@
#include "cogl-texture-driver.h"
#include "cogl-context.h"
#include "cogl-closure-list-private.h"
-#include "cogl-mutter.h"
#ifdef COGL_HAS_XLIB_SUPPORT
#include <X11/Xlib.h>
#endif
+typedef const CoglWinsysVtable *(*CoglCustomWinsysVtableGetter) (CoglRenderer *renderer);
+
struct _CoglRenderer
{
CoglObject _parent;
@@ -53,7 +54,7 @@ struct _CoglRenderer
const CoglDriverVtable *driver_vtable;
const CoglTextureDriver *texture_driver;
const CoglWinsysVtable *winsys_vtable;
- CoglWinsysVtableGetter custom_winsys_vtable_getter;
+ CoglCustomWinsysVtableGetter custom_winsys_vtable_getter;
CoglWinsysID winsys_id_override;
GList *constraints;
diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c
index e6575d808..23cd3f81f 100644
--- a/cogl/cogl/cogl-renderer.c
+++ b/cogl/cogl/cogl-renderer.c
@@ -565,8 +565,8 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
/* Final connection API */
void
-cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
- CoglWinsysVtableGetter winsys_vtable_getter)
+cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
+ CoglCustomWinsysVtableGetter winsys_vtable_getter)
{
renderer->custom_winsys_vtable_getter = winsys_vtable_getter;
}
@@ -575,10 +575,11 @@ static CoglBool
connect_custom_winsys (CoglRenderer *renderer,
CoglError **error)
{
- const CoglWinsysVtable *winsys = renderer->custom_winsys_vtable_getter();
+ const CoglWinsysVtable *winsys;
CoglError *tmp_error = NULL;
GString *error_message;
+ winsys = renderer->custom_winsys_vtable_getter (renderer);
renderer->winsys_vtable = winsys;
error_message = g_string_new ("");