window: add toysurface abstraction and port EGL path
authorPekka Paalanen <ppaalanen@gmail.com>
Mon, 19 Nov 2012 15:15:58 +0000 (17:15 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 27 Nov 2012 20:49:34 +0000 (15:49 -0500)
commit03fc316000cb24930ecd63f376cd5850434b7bca
treeaa5c46c16d7547a6331de1a492c4a6d33e7abb07
parentb88b68fa42086304f615ee9f67e9c290d059868b
window: add toysurface abstraction and port EGL path

We need more structure to the way we handle the backing storage in
toytoolkit, to make it possible to double-buffer the shm case properly.
The existing buffer handling is very complex with the three
different cases:
- EGLSurface backed Cairo surface with a window associated
- wl_shm backed Cairo surface with a window associated
- wl_shm backed Cairo surface without a window, as used by dnd.c

Introduce the toysurface abstraction, which defines the interface for
the both buffer handling cases that have a window associated. It also
means, that windows will not have a valid Cairo surface outside of their
repaint cycle.

Convert the EGLsurface case into toysurface for starters. For EGL-based
Cairo surfaces, the private data is no longer needed. Destroying
egl_window_surface will trigger the destruction of the cairo_surface_t,
not vice versa. This is possible because display_create_surface() is
shm-only.

The shm cases are left untouched.

As a side-effect, display_acquire_window_surface() and
display_release_window_surface() will no longer use the 'display'
argument. Instead, display will be the one inherited from the window.

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