![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtWaylandCompositor More...
#include <qwaylandbufferref.h>
Public Types | |
enum | BufferType { BufferType_Null , BufferType_SharedMemory , BufferType_Egl } |
enum | BufferFormatEgl { BufferFormatEgl_Null , BufferFormatEgl_RGB , BufferFormatEgl_RGBA , BufferFormatEgl_EXTERNAL_OES , BufferFormatEgl_Y_U_V , BufferFormatEgl_Y_UV , BufferFormatEgl_Y_XUXV } |
Public Member Functions | |
QWaylandBufferRef () | |
Constructs a null buffer ref. | |
QWaylandBufferRef (const QWaylandBufferRef &ref) | |
Creates a new reference to the buffer referenced by ref. | |
~QWaylandBufferRef () | |
Dereferences the buffer. | |
QWaylandBufferRef & | operator= (const QWaylandBufferRef &ref) |
Assigns ref to this buffer and adds a reference to it. | |
bool | isNull () const |
Returns true if this QWaylandBufferRef does not reference a buffer. | |
bool | hasBuffer () const |
Returns true if this QWaylandBufferRef references a buffer. | |
bool | hasContent () const |
Returns true if this QWaylandBufferRef references a buffer that has content. | |
bool | hasProtectedContent () const |
Returns true if this QWaylandBufferRef references a buffer that has protected content. | |
bool | isDestroyed () const |
Returns true if this QWaylandBufferRef references a buffer that has been destroyed. | |
struct wl_resource * | wl_buffer () const |
Returns the Wayland resource for the buffer. | |
QSize | size () const |
Returns the size of the buffer. | |
QWaylandSurface::Origin | origin () const |
Returns the origin of the buffer. | |
BufferType | bufferType () const |
BufferFormatEgl | bufferFormatEgl () const |
bool | isSharedMemory () const |
Returns true if the buffer is a shared memory buffer. | |
QImage | image () const |
Returns an image with the contents of the buffer. | |
quintptr | lockNativeBuffer () |
void | unlockNativeBuffer (quintptr handle) |
Friends | |
class | QWaylandBufferRefPrivate |
class | QWaylandSurfacePrivate |
Q_WAYLANDCOMPOSITOR_EXPORT bool | operator== (const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept |
Returns true if lhs references the same buffer as rhs. | |
bool | operator!= (const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept |
Returns false if lhs references the same buffer as rhs. | |
\inmodule QtWaylandCompositor
The QWaylandBufferRef class holds the reference to a surface buffer.
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.
Definition at line 27 of file qwaylandbufferref.h.
Enumerator | |
---|---|
BufferFormatEgl_Null | |
BufferFormatEgl_RGB | |
BufferFormatEgl_RGBA | |
BufferFormatEgl_EXTERNAL_OES | |
BufferFormatEgl_Y_U_V | |
BufferFormatEgl_Y_UV | |
BufferFormatEgl_Y_XUXV |
Definition at line 56 of file qwaylandbufferref.h.
Enumerator | |
---|---|
BufferType_Null | |
BufferType_SharedMemory | |
BufferType_Egl |
Definition at line 50 of file qwaylandbufferref.h.
QWaylandBufferRef::QWaylandBufferRef | ( | ) |
Constructs a null buffer ref.
Definition at line 61 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer.
QWaylandBufferRef::QWaylandBufferRef | ( | const QWaylandBufferRef & | ref | ) |
Creates a new reference to the buffer referenced by ref.
Definition at line 81 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, and QtWayland::ClientBuffer::ref().
QWaylandBufferRef::~QWaylandBufferRef | ( | ) |
Dereferences the buffer.
Definition at line 92 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, and QtWayland::ClientBuffer::deref().
QWaylandBufferRef::BufferFormatEgl QWaylandBufferRef::bufferFormatEgl | ( | ) | const |
Definition at line 238 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, QtWayland::ClientBuffer::bufferFormatEgl(), BufferFormatEgl_Null, and QWaylandBufferRefPrivate::nullOrDestroyed().
QWaylandBufferRef::BufferType QWaylandBufferRef::bufferType | ( | ) | const |
Definition at line 227 of file qwaylandbufferref.cpp.
References BufferType_Egl, BufferType_Null, BufferType_SharedMemory, isSharedMemory(), and QWaylandBufferRefPrivate::nullOrDestroyed().
bool QWaylandBufferRef::hasBuffer | ( | ) | const |
Returns true if this QWaylandBufferRef references a buffer.
Otherwise returns false.
Definition at line 150 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer.
Referenced by QWaylandSurfaceTextureProvider::setBufferRef().
bool QWaylandBufferRef::hasContent | ( | ) | const |
Returns true if this QWaylandBufferRef references a buffer that has content.
Otherwise returns false.
Definition at line 159 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, and QtWayland::ClientBuffer::hasContent().
Referenced by QWaylandSurfacePrivate::surface_commit().
bool QWaylandBufferRef::hasProtectedContent | ( | ) | const |
Returns true if this QWaylandBufferRef references a buffer that has protected content.
Otherwise returns false.
Definition at line 172 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, and QtWayland::ClientBuffer::hasProtectedContent().
QImage QWaylandBufferRef::image | ( | ) | const |
Returns an image with the contents of the buffer.
Definition at line 260 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, QtWayland::ClientBuffer::image(), and QWaylandBufferRefPrivate::nullOrDestroyed().
bool QWaylandBufferRef::isDestroyed | ( | ) | const |
Returns true if this QWaylandBufferRef references a buffer that has been destroyed.
Otherwise returns false.
Definition at line 181 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, and QtWayland::ClientBuffer::isDestroyed().
bool QWaylandBufferRef::isNull | ( | ) | const |
Returns true if this QWaylandBufferRef does not reference a buffer.
Otherwise returns false.
Definition at line 140 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer.
bool QWaylandBufferRef::isSharedMemory | ( | ) | const |
Returns true if the buffer is a shared memory buffer.
Otherwise returns false.
Definition at line 249 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, QtWayland::ClientBuffer::isSharedMemory(), and QWaylandBufferRefPrivate::nullOrDestroyed().
Referenced by bufferType().
quintptr QWaylandBufferRef::lockNativeBuffer | ( | ) |
QWaylandBufferRef & QWaylandBufferRef::operator= | ( | const QWaylandBufferRef & | ref | ) |
Assigns ref to this buffer and adds a reference to it.
The previously referenced buffer is dereferenced.
Definition at line 103 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, QtWayland::ClientBuffer::deref(), and QtWayland::ClientBuffer::ref().
QWaylandSurface::Origin QWaylandBufferRef::origin | ( | ) | const |
Returns the origin of the buffer.
If the buffer referenced is null, QWaylandSurface::OriginBottomLeft is returned.
Definition at line 219 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, QtWayland::ClientBuffer::origin(), and QWaylandSurface::OriginBottomLeft.
QSize QWaylandBufferRef::size | ( | ) | const |
Returns the size of the buffer.
If the buffer referenced is null, an invalid QSize() is returned.
Definition at line 206 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, QWaylandBufferRefPrivate::nullOrDestroyed(), and QtWayland::ClientBuffer::size().
Referenced by QWaylandSurfacePrivate::refView(), and QWaylandSurfacePrivate::surface_commit().
struct::wl_resource * QWaylandBufferRef::wl_buffer | ( | ) | const |
Returns the Wayland resource for the buffer.
Definition at line 189 of file qwaylandbufferref.cpp.
References QWaylandBufferRefPrivate::buffer, and QtWayland::ClientBuffer::waylandBufferHandle().
|
friend |
Returns false
if lhs references the same buffer as rhs.
Otherwise returns {true}
.
Definition at line 89 of file qwaylandbufferref.h.
|
friend |
Returns true
if lhs references the same buffer as rhs.
Otherwise returns {false}.
Definition at line 122 of file qwaylandbufferref.cpp.
|
friend |
Definition at line 83 of file qwaylandbufferref.h.
|
friend |
Definition at line 84 of file qwaylandbufferref.h.