14#define CHECK1(l, r, op) \
15 static_assert(std::is_same_v< \
17 decltype(std::declval<QWaylandBufferRef l >() op \
18 std::declval<QWaylandBufferRef r >()) \
84 d->buffer =
ref.d->buffer;
106 ref.d->buffer->ref();
111 d->buffer =
ref.d->buffer;
124 return lhs.d->buffer == rhs.d->buffer;
183 return d->buffer && d->buffer->isDestroyed();
191 return d->buffer ? d->buffer->waylandBufferHandle() :
nullptr;
208 if (d->nullOrDestroyed())
211 return d->buffer->size();
222 return d->buffer->origin();
229 if (d->nullOrDestroyed())
240 if (d->nullOrDestroyed())
243 return d->buffer->bufferFormatEgl();
251 if (d->nullOrDestroyed())
254 return d->buffer->isSharedMemory();
262 if (d->nullOrDestroyed())
265 return d->buffer->image();
278QOpenGLTexture *QWaylandBufferRef::toOpenGLTexture(
int plane)
const
280 if (d->nullOrDestroyed())
283 return d->buffer->toOpenGlTexture(plane);
294 return d->buffer->lockNativeBuffer();
303 d->buffer->unlockNativeBuffer(
handle);
\inmodule QtWaylandCompositor
QWaylandBufferRef & operator=(const QWaylandBufferRef &ref)
Assigns ref to this buffer and adds a reference to it.
bool hasContent() const
Returns true if this QWaylandBufferRef references a buffer that has content.
void unlockNativeBuffer(quintptr handle)
bool isDestroyed() const
Returns true if this QWaylandBufferRef references a buffer that has been destroyed.
QWaylandSurface::Origin origin() const
Returns the origin of the buffer.
bool hasProtectedContent() const
Returns true if this QWaylandBufferRef references a buffer that has protected content.
~QWaylandBufferRef()
Dereferences the buffer.
bool isSharedMemory() const
Returns true if the buffer is a shared memory buffer.
QWaylandBufferRef()
Constructs a null buffer ref.
quintptr lockNativeBuffer()
bool hasBuffer() const
Returns true if this QWaylandBufferRef references a buffer.
BufferFormatEgl bufferFormatEgl() const
bool isNull() const
Returns true if this QWaylandBufferRef does not reference a buffer.
@ BufferType_SharedMemory
BufferType bufferType() const
struct wl_resource * wl_buffer() const
Returns the Wayland resource for the buffer.
QSize size() const
Returns the size of the buffer.
QImage image() const
Returns an image with the contents of the buffer.
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
static bool hasProtectedContent(ClientBuffer *buffer)
static bool hasContent(ClientBuffer *buffer)
Combined button and popup list for selecting options.
GLuint64 GLenum void * handle
bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept