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
27
28namespace QtWaylandClient {
29
30class QWaylandDisplay;
31class QWaylandAbstractDecoration;
32class QWaylandWindow;
33
34class Q_WAYLANDCLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer {
35public:
39 QSize size() const override { return mImage.size(); }
40 int scale() const override { return int(mImage.devicePixelRatio()); }
41 QImage *image() { return &mImage; }
42
44
46
47 uint age() const { return mAge; }
48 void setAge(uint age) { mAge = age; }
49
50private:
52
54 struct wl_shm_pool *mShmPool = nullptr;
56 QImage *mMarginsImage = nullptr;
58 uint mAge = 0;
59};
60
61class Q_WAYLANDCLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore
62{
63public:
66
68 void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
69 void resize(const QSize &size, const QRegion &staticContents) override;
70 void beginPaint(const QRegion &region) override;
71 void endPaint() override;
72 bool scroll(const QRegion &region, int dx, int dy) override;
73
75
77 QImage *entireSurface() const;
78 QImage *contentSurface() const;
80 void finalizeBackBuffer();
81
84
85#if QT_CONFIG(opengl)
86 QImage toImage() const override;
87#endif
88
89private:
91
92 void updateDirtyStates(const QRegion &region);
93 void updateDecorations();
95
96 QWaylandDisplay *mDisplay = nullptr;
100 bool mPainting = false;
101 bool mPendingFlush = false;
104
107 struct wl_event_queue *mEventQueue = nullptr;
108};
109
110}
111
112QT_END_NAMESPACE
113
114#endif
Combined button and popup list for selecting options.
static QtWayland::wp_cursor_shape_device_v1::shape qtCursorShapeToWaylandShape(Qt::CursorShape cursorShape)