summaryrefslogtreecommitdiff
path: root/clients/subsurfaces.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-12-19 16:17:12 +0000
committerKristian Høgsberg <krh@bitplanet.net>2014-01-09 15:03:15 -0800
commit97b747cdda1ec32df3317a1df44d3c4a217f06d9 (patch)
treea99f48608866f4b875aa694852d813b324a7ec7b /clients/subsurfaces.c
parenta30e29af2e4d0ad6fc476ae7cc13c4cad5119217 (diff)
downloadweston-97b747cdda1ec32df3317a1df44d3c4a217f06d9.tar.gz
westoy: Add an option to explicitly disable cairo on a widget
The subsurfaces example creates a subsurface widget and uses EGL to render to it directly rather than using the cairo context from the widget. In theory this shouldn't cause any problems because the westoy window code lazily creates the cairo surface when an application creates a cairo context. However commit fdca95c7 changed the behaviour to force the lazy creation at the beginning of each surface redraw. This ends up making the triangle surface get two attaches – one from Cairo and one from the direct EGL. It looks like it would be difficult to reinstate the lazy surface creation behaviour whilst still maintaining the error handling for surface creation because none of the redraw handlers in the example clients are designed to cope with that. Instead, this patch adds an explicit option on a widget to disable creating the Cairo surface and the subsurface example now uses that. Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72854
Diffstat (limited to 'clients/subsurfaces.c')
-rw-r--r--clients/subsurfaces.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/clients/subsurfaces.c b/clients/subsurfaces.c
index 0f11009e..45cc44b4 100644
--- a/clients/subsurfaces.c
+++ b/clients/subsurfaces.c
@@ -498,6 +498,7 @@ triangle_create(struct window *window, struct egl_state *egl)
tri->egl = egl;
tri->widget = window_add_subsurface(window, tri,
int_to_mode(option_triangle_mode));
+ widget_set_use_cairo(tri->widget, 0);
widget_set_resize_handler(tri->widget, triangle_resize_handler);
widget_set_redraw_handler(tri->widget, triangle_redraw_handler);