9#include "wayland_wrapper/qwlclientbuffer_p.h"
15#define CHECK1(l, r, op)
16 static_assert(std::is_same_v<
18 decltype(std::declval<QWaylandBufferRef l >() op
19 std::declval<QWaylandBufferRef r >())
50
51
52
53
54
55
56
57
60
61
62QWaylandBufferRef::QWaylandBufferRef()
63 : d(
new QWaylandBufferRefPrivate)
69
70
71QWaylandBufferRef::QWaylandBufferRef(QtWayland::ClientBuffer *buffer)
72 : d(
new QWaylandBufferRefPrivate)
80
81
82QWaylandBufferRef::QWaylandBufferRef(
const QWaylandBufferRef &ref)
83 : d(
new QWaylandBufferRefPrivate)
85 d->buffer = ref.d->buffer;
91
92
93QWaylandBufferRef::~QWaylandBufferRef()
101
102
103
104QWaylandBufferRef &QWaylandBufferRef::operator=(
const QWaylandBufferRef &ref)
107 ref.d->buffer->ref();
112 d->buffer = ref.d->buffer;
118
119
120
121
122
123bool operator==(
const QWaylandBufferRef &lhs,
const QWaylandBufferRef &rhs)
noexcept
125 return lhs.d->buffer == rhs.d->buffer;
129
130
131
132
133
136
137
138
139
140
141bool QWaylandBufferRef::isNull()
const
147
148
149
150
151bool QWaylandBufferRef::hasBuffer()
const
156
157
158
159
160bool QWaylandBufferRef::hasContent()
const
162 return QtWayland::ClientBuffer::hasContent(d->buffer);
165
166
167
168
169
170
171
172
173bool QWaylandBufferRef::hasProtectedContent()
const
175 return QtWayland::ClientBuffer::hasProtectedContent(d->buffer);
179
180
181
182bool QWaylandBufferRef::isDestroyed()
const
184 return d->buffer && d->buffer->isDestroyed();
188
189
190struct ::wl_resource *QWaylandBufferRef::wl_buffer()
const
192 return d->buffer ? d->buffer->waylandBufferHandle() :
nullptr;
196
197
198QtWayland::ClientBuffer *QWaylandBufferRef::buffer()
const
204
205
206
207QSize QWaylandBufferRef::size()
const
209 if (d->nullOrDestroyed())
212 return d->buffer->size();
216
217
218
219
220QWaylandSurface::Origin QWaylandBufferRef::origin()
const
223 return d->buffer->origin();
225 return QWaylandSurface::OriginBottomLeft;
228QWaylandBufferRef::BufferType QWaylandBufferRef::bufferType()
const
230 if (d->nullOrDestroyed())
231 return BufferType_Null;
233 if (isSharedMemory())
234 return BufferType_SharedMemory;
236 return BufferType_Egl;
239QWaylandBufferRef::BufferFormatEgl QWaylandBufferRef::bufferFormatEgl()
const
241 if (d->nullOrDestroyed())
242 return BufferFormatEgl_Null;
244 return d->buffer->bufferFormatEgl();
248
249
250bool QWaylandBufferRef::isSharedMemory()
const
252 if (d->nullOrDestroyed())
255 return d->buffer->isSharedMemory();
259
260
261QImage QWaylandBufferRef::image()
const
263 if (d->nullOrDestroyed())
266 return d->buffer->image();
271
272
273
274
275
276
277
278
279QOpenGLTexture *QWaylandBufferRef::toOpenGLTexture(
int plane)
const
281 if (d->nullOrDestroyed())
284 return d->buffer->toOpenGlTexture(plane);
288
289
290
291
292
293quintptr QWaylandBufferRef::lockNativeBuffer()
295 return d->buffer->lockNativeBuffer();
299
300
301
302void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)
304 d->buffer->unlockNativeBuffer(handle);
QtWayland::ClientBuffer * buffer
Combined button and popup list for selecting options.
bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept