diff options
author | David Edmundson <davidedmundson@kde.org> | 2017-10-18 20:41:50 +0200 |
---|---|---|
committer | David Edmundson <davidedmundson@kde.org> | 2017-10-23 08:13:55 +0000 |
commit | 5f38652cd52c03e9df8600f5f41e044820c3062c (patch) | |
tree | f9e96378df5abb4ca57f0dc6a01c47a9177324f6 /src/client/qwaylandbuffer.cpp | |
parent | e77a47915c8838abc4750241c116694d397f3919 (diff) |
Ref count buffer usage
The QPlatformBackingStore can get flushed multiple times between paints.
Flush sets the front buffer, but it does not create a new backbuffer.
We can't do so without doing an expensive pre-emptive copy.
This means we send the same front buffer multiple times. This is
somewhat questionable with regards to the Wayland specification, but
seems to work.
If we do send a buffer multiple times we can't consider it free until
the last attached buffer is released; otherwise we end up painting into
a buffer whilst the server is still using it, leading to
flickering.
Change-Id: I8235eed6a85f0d52b37544e7bcb623b16a9dd832
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/client/qwaylandbuffer.cpp')
-rw-r--r-- | src/client/qwaylandbuffer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp index a0fcc532f..076a0d57d 100644 --- a/src/client/qwaylandbuffer.cpp +++ b/src/client/qwaylandbuffer.cpp @@ -66,7 +66,7 @@ void QWaylandBuffer::init(wl_buffer *buf) void QWaylandBuffer::release(void *data, wl_buffer *) { - static_cast<QWaylandBuffer *>(data)->mBusy = false; + static_cast<QWaylandBuffer *>(data)->mBusy--; } const wl_buffer_listener QWaylandBuffer::listener = { |