The QWaylandBufferRef class holds the reference to a surface buffer. More...
Header: | #include <QWaylandBufferRef> |
CMake: | find_package(Qt6 COMPONENTS Waylandcompositor REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Waylandcompositor) |
qmake: | QT += waylandcompositor |
Since: | Qt 5.8 |
QWaylandBufferRef(const QWaylandBufferRef &ref) | |
QWaylandBufferRef() | |
QWaylandBufferRef & | operator=(const QWaylandBufferRef &ref) |
~QWaylandBufferRef() | |
bool | hasBuffer() const |
bool | hasContent() const |
bool | hasProtectedContent() const |
QImage | image() const |
bool | isDestroyed() const |
bool | isNull() const |
bool | isSharedMemory() const |
quintptr | lockNativeBuffer() |
QWaylandSurface::Origin | origin() const |
QSize | size() const |
QOpenGLTexture * | toOpenGLTexture(int plane = 0) const |
void | unlockNativeBuffer(quintptr handle) |
struct wl_resource * | wl_buffer() const |
bool | operator!=(const QWaylandBufferRef &ref) |
bool | operator==(const QWaylandBufferRef &ref) |
This class can be used to reference a surface buffer. As long as a reference to the buffer exists, it is owned by the compositor and the client cannot modify it.
Creates a new reference to the buffer referenced by ref.
Constructs a null buffer ref.
Assigns ref to this buffer and adds a reference to it. The previously referenced buffer is dereferenced.
Dereferences the buffer.
Returns true if this QWaylandBufferRef references a buffer. Otherwise returns false.
See also isNull() and hasContent().
Returns true if this QWaylandBufferRef references a buffer that has content. Otherwise returns false.
See also isNull() and hasBuffer().
[since 6.2]
bool QWaylandBufferRef::hasProtectedContent() const
Returns true if this QWaylandBufferRef references a buffer that has protected content. Otherwise returns false.
Note: This is an enabler which presumes support in the client buffer integration. None of the client buffer integrations included with Qt currently support protected content buffers.
This function was introduced in Qt 6.2.
See also hasContent().
Returns an image with the contents of the buffer.
Returns true if this QWaylandBufferRef references a buffer that has been destroyed. Otherwise returns false.
Returns true if this QWaylandBufferRef does not reference a buffer. Otherwise returns false.
See also hasBuffer() and hasContent().
Returns true if the buffer is a shared memory buffer. Otherwise returns false.
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.
Returns the origin of the buffer. If the buffer referenced is null, QWaylandSurface::OriginBottomLeft is returned.
Returns the size of the buffer. If the buffer referenced is null, an invalid QSize() is returned.
Returns an OpenGL texture for the buffer. plane is the index for multi-plane formats, such as YUV.
The returned texture is owned by the buffer. The texture is only valid for as long as the buffer reference exists. The caller of this function must not delete the texture, and must keep a reference to the buffer for as long as the texture is being used.
Returns nullptr
if there is no valid buffer, or if no texture can be created.
Marks the native buffer as no longer in use. handle must correspond to the value returned by a previous call to lockNativeBuffer().
Returns the Wayland resource for the buffer.
Returns false if this QWaylandBufferRef references the same buffer as ref. Otherwise returns true.
Returns true if this QWaylandBufferRef references the same buffer as ref. Otherwise returns false.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qwaylandbufferref.html