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.h
Go to the documentation of this file.
1// Copyright (C) 2017 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDBUFFERREF_H
5#define QWAYLANDBUFFERREF_H
6
7#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
8#include <QtGui/QImage>
9
10#if QT_CONFIG(opengl)
11#include <QtGui/qopengl.h>
12#endif
13
14#include <QtWaylandCompositor/QWaylandSurface>
15
16struct wl_resource;
17
19
20class QOpenGLTexture;
21
22namespace QtWayland
23{
24 class ClientBuffer;
25}
26
27class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandBufferRef
28{
29public:
33
34 QWaylandBufferRef &operator=(const QWaylandBufferRef &ref);
35 bool isNull() const;
36 bool hasBuffer() const;
37 bool hasContent() const;
38 bool hasProtectedContent() const;
39 bool isDestroyed() const;
40#if QT_WAYLANDCOMPOSITOR_REMOVED_SINCE(6, 3)
41 bool operator==(const QWaylandBufferRef &ref);
42 bool operator!=(const QWaylandBufferRef &ref);
43#endif
44
45 struct wl_resource *wl_buffer() const;
46
47 QSize size() const;
48 QWaylandSurface::Origin origin() const;
49
55
65
66 BufferType bufferType() const;
67 BufferFormatEgl bufferFormatEgl() const;
68
69 bool isSharedMemory() const;
70 QImage image() const;
71
72#if QT_CONFIG(opengl)
73 QOpenGLTexture *toOpenGLTexture(int plane = 0) const;
74#endif
75
78
79private:
82 class QWaylandBufferRefPrivate *const d;
85
86 friend Q_WAYLANDCOMPOSITOR_EXPORT
87 bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept;
88 friend inline
89 bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept
90 { return !(lhs == rhs); }
91};
92
94
95#endif
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
\inmodule QtCore
Definition qsize.h:25
\inmodule QtWaylandCompositor
void unlockNativeBuffer(quintptr handle)
quintptr lockNativeBuffer()
friend bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) noexcept
Returns false if lhs references the same buffer as rhs.
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
Combined button and popup list for selecting options.
Definition image.cpp:4
constexpr bool operator!=(const timespec &t1, const timespec &t2)
GLuint64 GLenum void * handle
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint buffer
GLint ref
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
size_t quintptr
Definition qtypes.h:167