summaryrefslogtreecommitdiff
path: root/src/compositor/compositor_api/qwaylandbufferref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/compositor_api/qwaylandbufferref.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandbufferref.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp
index 8f7c63f4..90b3f1c4 100644
--- a/src/compositor/compositor_api/qwaylandbufferref.cpp
+++ b/src/compositor/compositor_api/qwaylandbufferref.cpp
@@ -277,6 +277,26 @@ QOpenGLTexture *QWaylandBufferRef::toOpenGLTexture(int plane) const
return d->buffer->toOpenGlTexture(plane);
}
+/*!
+ * Returns the native handle for this buffer, and marks it as locked so it will not be
+ * released until unlockNativeBuffer() is called.
+ *
+ * Returns 0 if there is no native handle for this buffer, or if the lock was unsuccessful.
+ */
+quintptr QWaylandBufferRef::lockNativeBuffer()
+{
+ return d->buffer->lockNativeBuffer();
+}
+
+/*!
+ * Marks the native buffer as no longer in use. \a handle must correspond to the value returned by
+ * a previous call to lockNativeBuffer().
+ */
+void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)
+{
+ d->buffer->unlockNativeBuffer(handle);
+}
+
#endif
QT_END_NAMESPACE