summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandbuffer_p.h
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2018-06-19 14:51:08 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2018-08-08 10:44:40 +0000
commit3c072f46b17a195daf1901d0c9f9410b4007b0a7 (patch)
treedaf02d062051f0f445d226d4fa708a6c5271335c /src/client/qwaylandbuffer_p.h
parent19001dc7c28c750d3dbf0086f5bcac2d11ad592f (diff)
Don't commit same buffer multiple times
In Qt we call flush() when we think the window might need to be updated. It is also possible to trigger a flush while painting. Two fixes: 1) If there are attempted flushes between beginPaint() and endPaint, queue them up, and do them in endPaint(). 2) Make sure we only commit the buffer once: after that the compositor owns the buffer, and it can repaint on its own. Change-Id: Ibf61068fa95760eb67dbc0b1d0534854114ea528 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/client/qwaylandbuffer_p.h')
-rw-r--r--src/client/qwaylandbuffer_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h
index 156ea9530..eea090f35 100644
--- a/src/client/qwaylandbuffer_p.h
+++ b/src/client/qwaylandbuffer_p.h
@@ -76,11 +76,15 @@ public:
void setBusy() { mBusy = true; }
bool busy() const { return mBusy; }
+ void setCommitted() { mCommitted = true; }
+ bool committed() const { return mCommitted; }
+
protected:
struct wl_buffer *mBuffer = nullptr;
private:
bool mBusy = false;
+ bool mCommitted = false;
static void release(void *data, wl_buffer *);
static const wl_buffer_listener listener;