wayland: don't prematurely release EGL buffers

commit 0165cb6974 changed
mutter to release committed shm buffers as soon as they were
uploaded to the GPU.

It also inadvertently changed mutter to prematurely
release EGL buffers (which never get copied, but get used
directly).

This commit corrects that mistake.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
This commit is contained in:
Ray Strode 2016-02-02 11:13:34 -05:00
parent 0165cb6974
commit 7adbb58736
3 changed files with 5 additions and 1 deletions

View File

@ -140,6 +140,9 @@ meta_wayland_buffer_ensure_texture (MetaWaylandBuffer *buffer)
buffer->texture = texture;
if (shm_buffer)
buffer->copied_data = TRUE;
out:
return buffer->texture;
}

View File

@ -41,6 +41,7 @@ struct _MetaWaylandBuffer
uint32_t ref_count;
uint32_t accessible : 1;
uint32_t copied_data : 1;
};
MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource);

View File

@ -608,7 +608,7 @@ apply_pending_state (MetaWaylandSurface *surface,
if (!cairo_region_is_empty (pending->damage))
surface_process_damage (surface, pending->damage);
if (pending->buffer)
if (pending->buffer && pending->buffer->copied_data)
meta_wayland_buffer_release_control (pending->buffer);
surface->offset_x += pending->dx;