westoy: Add an option to explicitly disable cairo on a widget
authorNeil Roberts <neil@linux.intel.com>
Thu, 19 Dec 2013 16:17:12 +0000 (16:17 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 9 Jan 2014 23:03:15 +0000 (15:03 -0800)
commit97b747cdda1ec32df3317a1df44d3c4a217f06d9
treea99f48608866f4b875aa694852d813b324a7ec7b
parenta30e29af2e4d0ad6fc476ae7cc13c4cad5119217
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
clients/subsurfaces.c
clients/window.c
clients/window.h