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
4
#
ifndef
QWAYLANDSHMBACKINGSTORE_H
5
#
define
QWAYLANDSHMBACKINGSTORE_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtWaylandClient
/
private
/
qwaylandbuffer_p
.
h
>
19
20
#
include
<
qpa
/
qplatformbackingstore
.
h
>
21
#
include
<
QtGui
/
QImage
>
22
#
include
<
qpa
/
qplatformwindow
.
h
>
23
#
include
<
QMutex
>
24
25
QT_BEGIN_NAMESPACE
26
27
namespace
QtWaylandClient
{
28
29
class
QWaylandDisplay;
30
class
QWaylandAbstractDecoration;
31
class
QWaylandWindow;
32
33
class
Q_WAYLANDCLIENT_EXPORT
QWaylandShmBuffer
:
public
QWaylandBuffer
{
34
public
:
35
QWaylandShmBuffer
(
QWaylandDisplay
*
display
,
36
const
QSize
&
size
,
QImage
::
Format
format
,
qreal
scale
= 1,
wl_event_queue
*
customEventQueue
=
nullptr
);
37
~
QWaylandShmBuffer
()
override
;
38
QSize
size
()
const
override
{
return
mImage
.
size
(); }
39
int
scale
()
const
override
{
return
int
(
mImage
.
devicePixelRatio
()); }
40
QImage
*
image
() {
return
&
mImage
; }
41
42
QImage
*
imageInsideMargins
(
const
QMargins
&
margins
);
43
44
QRegion
&
dirtyRegion
() {
return
mDirtyRegion
; }
45
46
uint
age
()
const
{
return
mAge
; }
47
void
setAge
(
uint
age
) {
mAge
=
age
; }
48
49
private
:
50
QImage
mImage
;
51
struct
wl_shm_pool
*
mShmPool
=
nullptr
;
52
QMargins
mMargins
;
53
QImage
*
mMarginsImage
=
nullptr
;
54
QRegion
mDirtyRegion
;
55
uint
mAge
= 0;
56
};
57
58
class
Q_WAYLANDCLIENT_EXPORT
QWaylandShmBackingStore
:
public
QPlatformBackingStore
59
{
60
public
:
61
QWaylandShmBackingStore
(
QWindow
*
window
,
QWaylandDisplay
*
display
);
62
~
QWaylandShmBackingStore
()
override
;
63
64
QPaintDevice
*
paintDevice
()
override
;
65
void
flush
(
QWindow
*
window
,
const
QRegion
&
region
,
const
QPoint
&
offset
)
override
;
66
void
resize
(
const
QSize
&
size
,
const
QRegion
&
staticContents
)
override
;
67
void
beginPaint
(
const
QRegion
&
region
)
override
;
68
void
endPaint
()
override
;
69
bool
scroll
(
const
QRegion
&
region
,
int
dx
,
int
dy
)
override
;
70
71
QWaylandAbstractDecoration
*
windowDecoration
()
const
;
72
73
QMargins
windowDecorationMargins
()
const
;
74
QImage
*
entireSurface
()
const
;
75
QImage
*
contentSurface
()
const
;
76
bool
recreateBackBufferIfNeeded
();
77
void
finalizeBackBuffer
();
78
79
QWaylandWindow
*
waylandWindow
()
const
;
80
void
iterateBuffer
();
81
82
#
if
QT_CONFIG
(
opengl
)
83
QImage
toImage
()
const
override
;
84
#
endif
85
86
private
:
87
void
updateDirtyStates
(
const
QRegion
&
region
);
88
void
updateDecorations
();
89
QWaylandShmBuffer
*
getBuffer
(
const
QSize
&
size
,
bool
&
bufferWasRecreated
);
90
91
QWaylandDisplay
*
mDisplay
=
nullptr
;
92
QList
<
QWaylandShmBuffer
*>
mBuffers
;
93
QWaylandShmBuffer
*
mFrontBuffer
=
nullptr
;
94
QWaylandShmBuffer
*
mBackBuffer
=
nullptr
;
95
bool
mPainting
=
false
;
96
bool
mPendingFlush
=
false
;
97
QRegion
mPendingRegion
;
98
QMutex
mMutex
;
99
100
QSize
mRequestedSize
;
101
Qt
::
WindowFlags
mCurrentWindowFlags
;
102
struct
wl_event_queue
*
mEventQueue
=
nullptr
;
103
};
104
105
}
106
107
QT_END_NAMESPACE
108
109
#
endif
QtWaylandClient::QWaylandShmBackingStore
Definition
qwaylandshmbackingstore_p.h:59
QtWaylandClient::QWaylandShmBuffer
Definition
qwaylandshmbackingstore_p.h:33
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
QtWaylandClient
Definition
qwaylandclientextension.h:15
QtWaylandClient::qtCursorShapeToWaylandShape
static QtWayland::wp_cursor_shape_device_v1::shape qtCursorShapeToWaylandShape(Qt::CursorShape cursorShape)
Definition
qwaylandcursor.cpp:223
QtWayland
Definition
qwaylanddisplay_p.h:51
qtbase
src
plugins
platforms
wayland
qwaylandshmbackingstore_p.h
Generated on
for Qt by
1.14.0