Client: Prune stale buffers in QWaylandShmBackingStore
A backing store may sometimes allocate an extra buffer and keep it even
though the buffer is never touched again.
This change makes the QWaylandShmBackingStore clean up the old buffers
more aggressively.
Specifically,
* if a buffer is referenced by the compositor and has a different size,
there is no need to wait for the buffer to be released, it can be
destroyed immediately
* if a buffer has not been used for the past 50 frames, it probably
won't be used any time soon so it can be disposed
Depending on the compositor implementation details, the
QWaylandShmBackingStore is likely to hold either one or two buffers
now. Note that the backing store can still sometimes have more buffers
because Qt widgets not always use QWindow::requestUpdate().
Change-Id: I57428d457d889dd07c4beb641cf380b1aceb88c2
Reviewed-by: David Edmundson <davidedmundson@kde.org>