compositor: refactor surface_attach()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 27 Mar 2012 14:36:40 +0000 (17:36 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 27 Mar 2012 20:36:53 +0000 (16:36 -0400)
commite11683aab28e297c1162d00dd3acba4a8c265538
tree1e5016b43655cfe09d74b068c64aa322e8f95028
parentd6ea33dfd6f71e070f1be77cf9c81707d818f468
compositor: refactor surface_attach()

surface_attach() does two things: sets up a new buffer as the contents
of the given surface and then calls into shell so it can setup the
position of the surface and map it if necessary. However we do not want
the shell to meddle with some internal surfaces such as drag surfaces.

The intention of this refactoring is to make room for making the part
that calls into shell a virtual function that the compositor can
override for these internal surfaces.

This changes weston_buffer_attach() so it handle all the logic of tying
a buffer to a surface, including unmapping it when the buffer is NULL.
The shell map() vs. configure() logic is then split into a another
function: surface_configure(). In a later commit, this function will be
turned into a function pointer in struct weston_surface.
src/compositor.c