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
25QT_BEGIN_NAMESPACE
26
27namespace QtWaylandClient {
28
29class QWaylandDisplay;
30class QWaylandAbstractDecoration;
31class QWaylandWindow;
32
33class Q_WAYLANDCLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer {
34public:
38 QSize size() const override { return mImage.size(); }
39 int scale() const override { return int(mImage.devicePixelRatio()); }
40 QImage *image() { return &mImage; }
41
43
45
46 uint age() const { return mAge; }
47 void setAge(uint age) { mAge = age; }
48
49private:
51 struct wl_shm_pool *mShmPool = nullptr;
53 QImage *mMarginsImage = nullptr;
55 uint mAge = 0;
56};
57
58class Q_WAYLANDCLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore
59{
60public:
63
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
72
74 QImage *entireSurface() const;
75 QImage *contentSurface() const;
77 void finalizeBackBuffer();
78
81
82#if QT_CONFIG(opengl)
83 QImage toImage() const override;
84#endif
85
86private:
87 void updateDirtyStates(const QRegion &region);
88 void updateDecorations();
90
91 QWaylandDisplay *mDisplay = nullptr;
95 bool mPainting = false;
96 bool mPendingFlush = false;
99
102 struct wl_event_queue *mEventQueue = nullptr;
103};
104
105}
106
107QT_END_NAMESPACE
108
109#endif
void setIcon(const QIcon &icon, ::xdg_toplevel *window)
QWaylandXdgToplevelIconManagerV1(QWaylandDisplay *display, wl_registry *registry, uint32_t id, int version)
QWaylandXdgToplevelIconV1(::xdg_toplevel_icon_v1 *object, QWaylandDisplay *display)