window: create Cairo surfaces on demand for redraw
authorPekka Paalanen <ppaalanen@gmail.com>
Wed, 13 Feb 2013 14:17:23 +0000 (16:17 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 14 Feb 2013 17:35:14 +0000 (12:35 -0500)
commit0c4445ba5756e51007606028bce00b2ecb352bd7
treefe85c1b478b40f786ccff31a032b2586438f7482
parent0a9686f51ce4f5ef1812c5ef12928bb35beb12eb
window: create Cairo surfaces on demand for redraw

This introduces the function widget_cairo_create().

Instead of directly referencing surface->cairo_surface, use the function
widget_cairo_create(), which will create the cairo_surface as necessary,
and just returns a Cairo drawing context. Also fix window_get_surface()
similarly.

Now we can go through idle_redraw() without always creating Cairo
surfaces and committing them. This will be useful with sub-surfaces,
where repainting one sub-surface does not need to force the repaint of
all surfaces of a window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
clients/window.c
clients/window.h