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 struct wl_shm_pool *mShmPool = nullptr;
54 QImage *mMarginsImage = nullptr;
56 uint mAge = 0;
57};
58
59class Q_WAYLANDCLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore
60{
61public:
64
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
73
75 QImage *entireSurface() const;
76 QImage *contentSurface() const;
78 void finalizeBackBuffer();
79
82
83#if QT_CONFIG(opengl)
84 QImage toImage() const override;
85#endif
86
87private:
88 void updateDirtyStates(const QRegion &region);
89 void updateDecorations();
91
92 QWaylandDisplay *mDisplay = nullptr;
96 bool mPainting = false;
97 bool mPendingFlush = false;
100
103 struct wl_event_queue *mEventQueue = nullptr;
104};
105
106}
107
108QT_END_NAMESPACE
109
110#endif
Combined button and popup list for selecting options.
static QtWayland::wp_cursor_shape_device_v1::shape qtCursorShapeToWaylandShape(Qt::CursorShape cursorShape)