Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qwlclientbuffer_p.h
Go to the documentation of this file.
1
// Copyright (C) 2019 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QWLCLIENTBUFFER_P_H
6
#
define
QWLCLIENTBUFFER_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtCore
/
QRect
>
20
#
include
<
QtGui
/
qopengl
.
h
>
21
#
include
<
QImage
>
22
#
include
<
QAtomicInt
>
23
#
include
<
QScopedPointer
>
24
25
#
include
<
QtWaylandCompositor
/
QWaylandSurface
>
26
#
include
<
QtWaylandCompositor
/
QWaylandBufferRef
>
27
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
28
29
#
include
<
wayland
-
server
-
core
.
h
>
30
31
QT_BEGIN_NAMESPACE
32
33
class
QWaylandSurfaceTextureProvider;
34
class
QWaylandClientBufferIntegration;
35
class
QWaylandBufferRef;
36
class
QWaylandCompositor;
37
class
QOpenGLTexture;
38
39
namespace
QtWayland
{
40
41
struct
surface_buffer_destroy_listener
42
{
43
struct
wl_listener
listener
;
44
class
ClientBuffer *
surfaceBuffer
=
nullptr
;
45
};
46
47
class
Q_WAYLANDCOMPOSITOR_EXPORT
ClientBuffer
48
{
49
public
:
50
ClientBuffer
(
struct
::
wl_resource
*
bufferResource
);
51
52
virtual
~
ClientBuffer
();
53
54
virtual
QWaylandBufferRef
::
BufferFormatEgl
bufferFormatEgl
()
const
;
55
virtual
QSize
size
()
const
= 0;
56
virtual
QWaylandSurface
::
Origin
origin
()
const
= 0;
57
58
virtual
quintptr
lockNativeBuffer
() {
return
0; }
59
virtual
void
unlockNativeBuffer
(
quintptr
native_buffer
)
const
{
Q_UNUSED
(
native_buffer
); }
60
61
virtual
QImage
image
()
const
{
return
QImage
(); }
62
63
inline
bool
isCommitted
()
const
{
return
m_committed
; }
64
virtual
void
setCommitted
(
QRegion
&
damage
);
65
bool
isDestroyed
() {
return
m_destroyed
; }
66
67
virtual
bool
isProtected
() {
return
false
; }
68
69
inline
struct
::
wl_resource
*
waylandBufferHandle
()
const
{
return
m_buffer
; }
70
71
bool
isSharedMemory
()
const
{
return
wl_shm_buffer_get
(
m_buffer
); }
72
73
#
if
QT_CONFIG
(
opengl
)
74
virtual
QOpenGLTexture
*
toOpenGlTexture
(
int
plane
= 0) = 0;
75
#
endif
76
77
static
bool
hasContent
(
ClientBuffer
*
buffer
) {
return
buffer
&&
buffer
->
waylandBufferHandle
(); }
78
static
bool
hasProtectedContent
(
ClientBuffer
*
buffer
) {
return
buffer
&&
buffer
->
isProtected
(); }
79
80
protected
:
81
void
ref
();
82
void
deref
();
83
void
sendRelease
();
84
virtual
void
setDestroyed
();
85
86
struct
::
wl_resource
*
m_buffer
=
nullptr
;
87
QRegion
m_damage
;
88
bool
m_textureDirty
=
false
;
89
90
private
:
91
bool
m_committed
=
false
;
92
bool
m_destroyed
=
false
;
93
94
QAtomicInt
m_refCount
;
95
96
friend
class
::
QWaylandBufferRef
;
97
friend
class
BufferManager
;
98
friend
class
::
QWaylandSurfaceTextureProvider
;
99
};
100
101
class
Q_WAYLANDCOMPOSITOR_EXPORT
SharedMemoryBuffer
:
public
ClientBuffer
102
{
103
public
:
104
SharedMemoryBuffer
(
struct
::
wl_resource
*
bufferResource
);
105
106
QSize
size
()
const
override
;
107
QWaylandSurface
::
Origin
origin
()
const
override
;
108
QImage
image
()
const
override
;
109
110
#
if
QT_CONFIG
(
opengl
)
111
QOpenGLTexture
*
toOpenGlTexture
(
int
plane
= 0)
override
;
112
113
private
:
114
QScopedPointer
<
QOpenGLTexture
>
m_shmTexture
;
115
#
endif
116
};
117
118
}
119
120
QT_END_NAMESPACE
121
122
#
endif
// QWLCLIENTBUFFER_P_H
QWaylandInputMethodControl
Definition
qwaylandinputmethodcontrol.h:20
QWaylandSurfacePrivate
Definition
qwaylandsurface_p.h:58
QWaylandSurfaceRole
\inmodule QtWaylandCompositor
Definition
qwaylandsurface.h:32
QWaylandSurfaceRole::QWaylandSurfaceRole
QWaylandSurfaceRole(const QByteArray &n)
Creates a QWaylandSurfaceRole and assigns it name.
Definition
qwaylandsurface.h:34
QWaylandSurfaceRole::name
const QByteArray name()
Returns the name of the QWaylandSurfaceRole.
Definition
qwaylandsurface.h:36
QWaylandSurface
\qmltype WaylandSurface \nativetype QWaylandSurface \inqmlmodule QtWayland.Compositor
Definition
qwaylandsurface.h:43
QtWayland::BufferManager
Definition
qwlbuffermanager_p.h:31
QtWayland::ClientBuffer
Definition
qwlclientbuffer_p.h:48
QtWayland::FrameCallback
Definition
qwaylandsurface.cpp:40
QtWayland::FrameCallback::resource
wl_resource * resource
Definition
qwaylandsurface.cpp:73
QtWayland::FrameCallback::destroy
void destroy()
Definition
qwaylandsurface.cpp:51
QtWayland::FrameCallback::FrameCallback
FrameCallback(QWaylandSurface *surf, wl_resource *res)
Definition
qwaylandsurface.cpp:42
QtWayland::FrameCallback::sendAndDestroy
void sendAndDestroy(uint time)
Definition
qwaylandsurface.cpp:59
QtWayland::FrameCallback::surface
QWaylandSurface * surface
Definition
qwaylandsurface.cpp:72
QtWayland::FrameCallback::~FrameCallback
~FrameCallback()
Definition
qwaylandsurface.cpp:48
QtWayland::FrameCallback::destroyCallback
static void destroyCallback(wl_resource *res)
Definition
qwaylandsurface.cpp:65
QtWayland::SharedMemoryBuffer
Definition
qwlclientbuffer_p.h:102
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtWayland
Definition
qwaylanddisplay_p.h:54
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
infiniteRegion
static QRegion infiniteRegion()
Definition
qwaylandsurface.cpp:76
QtWayland::surface_buffer_destroy_listener
Definition
qwlclientbuffer_p.h:42
QtWayland::surface_buffer_destroy_listener::listener
struct wl_listener listener
Definition
qwlclientbuffer_p.h:43
QtWayland::surface_buffer_destroy_listener::surfaceBuffer
class ClientBuffer * surfaceBuffer
Definition
qwlclientbuffer_p.h:44
qtwayland
src
compositor
wayland_wrapper
qwlclientbuffer_p.h
Generated on
for Qt by
1.18.0