Revert "Ref count buffer usage"

When a buffer is committed multiple times, not all compositors (i.e. Weston)
send a matching number of release events. This caused clients to freeze on some
occasions on those compositors because they were waiting for a release event
that never came.

This reverts commit 1fbffb9dfb011c3b7c7aaa41b7be3a8167ce0c8a.

Task-number: QTBUG-64631
Change-Id: I818d9bd71e5d9ce7a351a2010914b7219b1975bc
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Johan Klokkhammer Helsing 2017-11-21 10:13:43 +01:00 committed by Jani Heikkinen
parent dd6248faff
commit f1b07ea1ee
2 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ void QWaylandBuffer::init(wl_buffer *buf)
void QWaylandBuffer::release(void *data, wl_buffer *) void QWaylandBuffer::release(void *data, wl_buffer *)
{ {
static_cast<QWaylandBuffer *>(data)->mBusy--; static_cast<QWaylandBuffer *>(data)->mBusy = false;
} }
const wl_buffer_listener QWaylandBuffer::listener = { const wl_buffer_listener QWaylandBuffer::listener = {

View File

@ -73,14 +73,14 @@ public:
virtual QSize size() const = 0; virtual QSize size() const = 0;
virtual int scale() const { return 1; } virtual int scale() const { return 1; }
void setBusy() { mBusy++; } void setBusy() { mBusy = true; }
bool busy() const { return mBusy > 0; } bool busy() const { return mBusy; }
protected: protected:
struct wl_buffer *mBuffer; struct wl_buffer *mBuffer;
private: private:
int mBusy; bool mBusy;
static void release(void *data, wl_buffer *); static void release(void *data, wl_buffer *);
static const wl_buffer_listener listener; static const wl_buffer_listener listener;