wayland: Move buffer use count to MetaWaylandSurface

Each wl_surface.commit with a newly attached buffer should result in
one wl_buffer.release for the attached buffer. For example attaching
the same buffer to two different surfaces must always result in two
wl_buffer.release events being emitted by the server. The client is
responsible for counting the wl_buffer.release events and be sure to
have received as many release events as it has attached and committed
the buffer, before reusing it.

https://bugzilla.gnome.org/show_bug.cgi?id=762828
This commit is contained in:
Jonas Ådahl
2016-03-16 14:47:53 +08:00
parent aa7bc501d5
commit 10a0114856
7 changed files with 117 additions and 99 deletions

View File

@ -726,7 +726,7 @@ client_window_should_be_mapped (MetaWindow *window)
{
#ifdef HAVE_WAYLAND
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
!window->surface->buffer)
!meta_wayland_surface_get_buffer (window->surface))
return FALSE;
#endif
@ -1554,7 +1554,7 @@ meta_window_should_be_showing (MetaWindow *window)
{
#ifdef HAVE_WAYLAND
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
!window->surface->buffer)
!meta_wayland_surface_get_buffer (window->surface))
return FALSE;
#endif