[clutter/wip/wayland: 39/45] wayland/x11: Set constraints on the CoglRenderer
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/wayland: 39/45] wayland/x11: Set constraints on the CoglRenderer
- Date: Wed, 22 Feb 2012 18:02:59 +0000 (UTC)
commit a92bd058772afcd5de1b1907c6131153e942124b
Author: Neil Roberts <neil linux intel com>
Date: Thu Jan 26 12:32:52 2012 +0000
wayland/x11: Set constraints on the CoglRenderer
The wayland backend already set a constraint to require that the
CoglRenderer use a winsys that supports EGL. However the backend more
explicitly requires that the renderer also support Wayland so I think
it makes more sense to just explicitly select the Wayland EGL
renderer.
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 | 4 ++--
clutter/x11/clutter-backend-x11.c | 2 ++
3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c
index 488008f..654f9a5 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 9fbf42b..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,
@@ -222,8 +224,6 @@ clutter_backend_wayland_get_renderer (ClutterBackend *backend,
cogl_wayland_renderer_set_foreign_shell (renderer,
backend_wayland->wayland_shell);
- cogl_renderer_add_constraint (renderer, COGL_RENDERER_CONSTRAINT_USES_EGL);
-
return 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]