-
Committer:
Tarmac
-
Author(s):
Christopher James Halse Rogers
-
Date:
2017-09-22 00:49:12 UTC
-
mfrom:
(4257.3.1 trunk)
-
Revision ID:
tarmac-20170922004912-2508jl66b7ev537c
mgm::BufferAllocator: Handle a wl_buffer being attached multiple times.
As with the WlShmBuffer, it's valid for a wl_buffer to be wl_surface.attach()ed to multiple wl_surface-s at the same time. If a buffer is attached twice then the buffer.release() event needs to be sent exactly once, when the compositor is finished with *all* submissions.
So, do what we do with WlShmBuffer - associate a shared_ptr<WaylandBuffer> with each wl_buffer, and hand out references to it rather than creating a new WaylandBuffer on each (committed) attach().
.
Approved by mir-ci-bot, Gerry Boland, Alan Griffiths.