Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QWaylandBufferRef Class Reference

\inmodule QtWaylandCompositor More...

#include <qwaylandbufferref.h>

+ Collaboration diagram for QWaylandBufferRef:

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.
 
QWaylandBufferRefoperator= (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.
 

Detailed Description

\inmodule QtWaylandCompositor

Since
5.8

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.

Member Enumeration Documentation

◆ BufferFormatEgl

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.

◆ BufferType

Enumerator
BufferType_Null 
BufferType_SharedMemory 
BufferType_Egl 

Definition at line 50 of file qwaylandbufferref.h.

Constructor & Destructor Documentation

◆ QWaylandBufferRef() [1/2]

QWaylandBufferRef::QWaylandBufferRef ( )

Constructs a null buffer ref.

Definition at line 61 of file qwaylandbufferref.cpp.

◆ QWaylandBufferRef() [2/2]

QWaylandBufferRef::QWaylandBufferRef ( const QWaylandBufferRef & ref)

Creates a new reference to the buffer referenced by ref.

Definition at line 81 of file qwaylandbufferref.cpp.

◆ ~QWaylandBufferRef()

QWaylandBufferRef::~QWaylandBufferRef ( )

Dereferences the buffer.

Definition at line 92 of file qwaylandbufferref.cpp.

Member Function Documentation

◆ bufferFormatEgl()

QWaylandBufferRef::BufferFormatEgl QWaylandBufferRef::bufferFormatEgl ( ) const

Definition at line 238 of file qwaylandbufferref.cpp.

References BufferFormatEgl_Null.

◆ bufferType()

QWaylandBufferRef::BufferType QWaylandBufferRef::bufferType ( ) const

Definition at line 227 of file qwaylandbufferref.cpp.

References BufferType_Egl, BufferType_Null, BufferType_SharedMemory, and isSharedMemory().

+ Here is the call graph for this function:

◆ hasBuffer()

bool QWaylandBufferRef::hasBuffer ( ) const

Returns true if this QWaylandBufferRef references a buffer.

Otherwise returns false.

See also
isNull(), hasContent()

Definition at line 150 of file qwaylandbufferref.cpp.

◆ hasContent()

bool QWaylandBufferRef::hasContent ( ) const

Returns true if this QWaylandBufferRef references a buffer that has content.

Otherwise returns false.

See also
isNull(), hasBuffer()

Definition at line 159 of file qwaylandbufferref.cpp.

References QtWayland::ClientBuffer::hasContent().

Referenced by QWaylandSurfacePrivate::surface_commit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasProtectedContent()

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.
Since
6.2
See also
hasContent()

Definition at line 172 of file qwaylandbufferref.cpp.

References QtWayland::ClientBuffer::hasProtectedContent().

+ Here is the call graph for this function:

◆ image()

QImage QWaylandBufferRef::image ( ) const

Returns an image with the contents of the buffer.

Definition at line 260 of file qwaylandbufferref.cpp.

◆ isDestroyed()

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.

◆ isNull()

bool QWaylandBufferRef::isNull ( ) const

Returns true if this QWaylandBufferRef does not reference a buffer.

Otherwise returns false.

See also
hasBuffer(), hasContent()

Definition at line 140 of file qwaylandbufferref.cpp.

◆ isSharedMemory()

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.

Referenced by bufferType().

+ Here is the caller graph for this function:

◆ lockNativeBuffer()

quintptr QWaylandBufferRef::lockNativeBuffer ( )

◆ operator=()

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.

◆ origin()

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 QWaylandSurface::OriginBottomLeft.

◆ size()

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.

Referenced by QWaylandSurfacePrivate::refView(), and QWaylandSurfacePrivate::surface_commit().

+ Here is the caller graph for this function:

◆ unlockNativeBuffer()

void QWaylandBufferRef::unlockNativeBuffer ( quintptr handle)

◆ wl_buffer()

struct::wl_resource * QWaylandBufferRef::wl_buffer ( ) const

Returns the Wayland resource for the buffer.

Definition at line 189 of file qwaylandbufferref.cpp.

Friends And Related Symbol Documentation

◆ operator!=

bool QWaylandBufferRef::operator!= ( const QWaylandBufferRef & lhs,
const QWaylandBufferRef & rhs )
friend

Returns false if lhs references the same buffer as rhs.

Otherwise returns {true}.

Definition at line 89 of file qwaylandbufferref.h.

◆ operator==

bool QWaylandBufferRef::operator== ( const QWaylandBufferRef & lhs,
const QWaylandBufferRef & rhs )
friend

Returns true if lhs references the same buffer as rhs.

Otherwise returns {false}.

Definition at line 122 of file qwaylandbufferref.cpp.

◆ QWaylandBufferRefPrivate

friend class QWaylandBufferRefPrivate
friend

Definition at line 83 of file qwaylandbufferref.h.

◆ QWaylandSurfacePrivate

friend class QWaylandSurfacePrivate
friend

Definition at line 84 of file qwaylandbufferref.h.


The documentation for this class was generated from the following files: