[clutter/wip/wayland-2: 19/22] wayland/x11: Set constraints on the CoglRenderer
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/wayland-2: 19/22] wayland/x11: Set constraints on the CoglRenderer
- Date: Wed, 29 Feb 2012 17:58:09 +0000 (UTC)
commit 30a69e460576b6e76efddfb009fdb10d9c014fc7
Author: Neil Roberts <neil linux intel com>
Date: Wed Feb 29 16:35:48 2012 +0000
wayland/x11: Set constraints on the CoglRenderer
When using the Wayland backend this sets a constraint that the
CoglRenderer selects the Wayland EGL winsys.
When a Wayland compositor display is set it now also sets a constraint
that the render should use EGL because only EGL renderers will set up
the required wl_drm global object.
The X11 backend now sets the X11 constraint.
clutter/clutter-backend.c | 6 ++++++
clutter/wayland/clutter-backend-wayland.c | 2 ++
clutter/x11/clutter-backend-x11.c | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index 849365b..6142af8 100644
--- a/clutter/clutter-backend.c
+++ b/clutter/clutter-backend.c
@@ -269,6 +269,12 @@ clutter_backend_real_create_context (ClutterBackend *backend,
if (backend->cogl_renderer == NULL)
goto error;
+ /* If the application is trying to act as a Wayland compositor then
+ it needs to have an EGL-based renderer backend */
+ if (_wayland_compositor_display)
+ cogl_renderer_add_constraint (backend->cogl_renderer,
+ COGL_RENDERER_CONSTRAINT_USES_EGL);
+
CLUTTER_NOTE (BACKEND, "Connecting the renderer");
if (!cogl_renderer_connect (backend->cogl_renderer, &internal_error))
goto error;
diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c
index f72937e..db5613c 100644
--- a/clutter/wayland/clutter-backend-wayland.c
+++ b/clutter/wayland/clutter-backend-wayland.c
@@ -215,6 +215,8 @@ clutter_backend_wayland_get_renderer (ClutterBackend *backend,
renderer = cogl_renderer_new ();
+ cogl_renderer_set_winsys_id (renderer, COGL_WINSYS_ID_EGL_WAYLAND);
+
cogl_wayland_renderer_set_foreign_display (renderer,
backend_wayland->wayland_display);
cogl_wayland_renderer_set_foreign_compositor (renderer,
diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c
index acafccb..b05a5e8 100644
--- a/clutter/x11/clutter-backend-x11.c
+++ b/clutter/x11/clutter-backend-x11.c
@@ -697,6 +697,8 @@ clutter_backend_x11_get_renderer (ClutterBackend *backend,
renderer = cogl_renderer_new ();
+ cogl_renderer_add_constraint (renderer, COGL_RENDERER_CONSTRAINT_USES_X11);
+
/* set the display object we're using */
cogl_xlib_renderer_set_foreign_display (renderer, xdisplay);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]