summaryrefslogtreecommitdiff
path: root/src/compositor/compositor_api/qwaylandquickitem_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-08-13 08:13:57 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-08-31 15:19:50 +0200
commit307a82a2de4de48cae05a6aed26c7310d5325d12 (patch)
treec6f296a292595d226ca9aa10fb6f7190d31d96e2 /src/compositor/compositor_api/qwaylandquickitem_p.h
parent3ff4cd600454d1589228aeb68230336d6b721839 (diff)
downloadqtwayland-307a82a2de4de48cae05a6aed26c7310d5325d12.tar.gz
Keep reference to buffer until it has been replaced
For the code path which uses QWaylandBufferMaterial, the buffer could potentially be deleted before the material had been updated, which could cause issues if the render thread was currently using the textures. In the default code path this was handled by keeping a reference to the buffer in the texture provider, but in the alternative YUV format code path, we did not increase the reference count of the buffer, so it would be deleted immediately when it was replaced rather than wait for the sync with the render thread. Task-number: QTBUG-95715 Change-Id: Ic6038ea8281e2a2e292d12150d1fffedb5c3b76e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 6b9a27d77e226a3d0ce9fa9b4974f70c9ef4a30e)
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem_p.h')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h
index 1c7ce55c..e8a4f0b6 100644
--- a/src/compositor/compositor_api/qwaylandquickitem_p.h
+++ b/src/compositor/compositor_api/qwaylandquickitem_p.h
@@ -80,6 +80,7 @@ public:
~QWaylandBufferMaterial() override;
void setTextureForPlane(int plane, QOpenGLTexture *texture);
+ void setBufferRef(QWaylandQuickItem *surfaceItem, const QWaylandBufferRef &ref);
void bind();
@@ -92,6 +93,7 @@ private:
const QWaylandBufferRef::BufferFormatEgl m_format;
QVarLengthArray<QOpenGLTexture*, 3> m_textures;
+ QWaylandBufferRef m_bufferRef;
};
#endif // QT_CONFIG(opengl)