Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandshmbackingstore_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QWAYLANDSHMBACKINGSTORE_H
6
#
define
QWAYLANDSHMBACKINGSTORE_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
<
QtWaylandClient
/
private
/
qwaylandbuffer_p
.
h
>
20
21
#
include
<
qpa
/
qplatformbackingstore
.
h
>
22
#
include
<
QtGui
/
QImage
>
23
#
include
<
qpa
/
qplatformwindow
.
h
>
24
#
include
<
QMutex
>
25
26
QT_BEGIN_NAMESPACE
27
28
namespace
QtWaylandClient
{
29
30
class
QWaylandDisplay;
31
class
QWaylandAbstractDecoration;
32
class
QWaylandWindow;
33
34
class
Q_WAYLANDCLIENT_EXPORT
QWaylandShmBuffer
:
public
QWaylandBuffer
{
35
public
:
36
QWaylandShmBuffer
(
QWaylandDisplay
*
display
,
37
const
QSize
&
size
,
QImage
::
Format
format
,
qreal
scale
= 1,
wl_event_queue
*
customEventQueue
=
nullptr
);
38
~
QWaylandShmBuffer
()
override
;
39
QSize
size
()
const
override
{
return
mImage
.
size
(); }
40
int
scale
()
const
override
{
return
int
(
mImage
.
devicePixelRatio
()); }
41
QImage
*
image
() {
return
&
mImage
; }
42
43
QImage
*
imageInsideMargins
(
const
QMargins
&
margins
);
44
45
QRegion
&
dirtyRegion
() {
return
mDirtyRegion
; }
46
47
uint
age
()
const
{
return
mAge
; }
48
void
setAge
(
uint
age
) {
mAge
=
age
; }
49
50
private
:
51
QImage
mImage
;
52
struct
wl_shm_pool
*
mShmPool
=
nullptr
;
53
QMargins
mMargins
;
54
QImage
*
mMarginsImage
=
nullptr
;
55
QRegion
mDirtyRegion
;
56
uint
mAge
= 0;
57
};
58
59
class
Q_WAYLANDCLIENT_EXPORT
QWaylandShmBackingStore
:
public
QPlatformBackingStore
60
{
61
public
:
62
QWaylandShmBackingStore
(
QWindow
*
window
,
QWaylandDisplay
*
display
);
63
~
QWaylandShmBackingStore
()
override
;
64
65
QPaintDevice
*
paintDevice
()
override
;
66
void
flush
(
QWindow
*
window
,
const
QRegion
&
region
,
const
QPoint
&
offset
)
override
;
67
void
resize
(
const
QSize
&
size
,
const
QRegion
&
staticContents
)
override
;
68
void
beginPaint
(
const
QRegion
&
region
)
override
;
69
void
endPaint
()
override
;
70
bool
scroll
(
const
QRegion
&
region
,
int
dx
,
int
dy
)
override
;
71
72
QWaylandAbstractDecoration
*
windowDecoration
()
const
;
73
74
QMargins
windowDecorationMargins
()
const
;
75
QImage
*
entireSurface
()
const
;
76
QImage
*
contentSurface
()
const
;
77
bool
recreateBackBufferIfNeeded
();
78
void
finalizeBackBuffer
();
79
80
QWaylandWindow
*
waylandWindow
()
const
;
81
void
iterateBuffer
();
82
83
#
if
QT_CONFIG
(
opengl
)
84
QImage
toImage
()
const
override
;
85
#
endif
86
87
private
:
88
void
updateDirtyStates
(
const
QRegion
&
region
);
89
void
updateDecorations
();
90
QWaylandShmBuffer
*
getBuffer
(
const
QSize
&
size
,
bool
&
bufferWasRecreated
);
91
92
QWaylandDisplay
*
mDisplay
=
nullptr
;
93
QList
<
QWaylandShmBuffer
*>
mBuffers
;
94
QWaylandShmBuffer
*
mFrontBuffer
=
nullptr
;
95
QWaylandShmBuffer
*
mBackBuffer
=
nullptr
;
96
bool
mPainting
=
false
;
97
bool
mPendingFlush
=
false
;
98
QRegion
mPendingRegion
;
99
QMutex
mMutex
;
100
101
QSize
mRequestedSize
;
102
Qt
::
WindowFlags
mCurrentWindowFlags
;
103
struct
wl_event_queue
*
mEventQueue
=
nullptr
;
104
};
105
106
}
107
108
QT_END_NAMESPACE
109
110
#
endif
QtWaylandClient::QWaylandShmBackingStore
Definition
qwaylandshmbackingstore_p.h:60
QtWaylandClient::QWaylandShmBuffer
Definition
qwaylandshmbackingstore_p.h:34
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
QtWaylandClient
Definition
qwaylandclientextension.h:16
QtWaylandClient::qtCursorShapeToWaylandShape
static QtWayland::wp_cursor_shape_device_v1::shape qtCursorShapeToWaylandShape(Qt::CursorShape cursorShape)
Definition
qwaylandcursor.cpp:224
QtWayland
Definition
qwaylanddisplay_p.h:52
qtbase
src
plugins
platforms
wayland
qwaylandshmbackingstore_p.h
Generated on
for Qt by
1.16.1