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
vsp2hardwarelayerintegration.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef VSP2HARDWARELAYERINTEGRATION_H
5#define VSP2HARDWARELAYERINTEGRATION_H
6
7#include <QtWaylandCompositor/private/qwlhardwarelayerintegration_p.h>
8#include <private/qobject_p.h>
9
10#include <QPoint>
11#include <QSize>
12
13struct wl_kms_buffer;
14
15QT_BEGIN_NAMESPACE
16
17namespace QNativeInterface::Private {
18struct QVsp2Screen;
19}
20
21class QScreen;
22class QWaylandSurface;
23class QWaylandQuickHardwareLayer;
24
25class Vsp2Layer;
26
28{
30public:
32
33 void add(QWaylandQuickHardwareLayer *layer) override;
34 void remove(QWaylandQuickHardwareLayer *layer) override;
35
36 void sendFrameCallbacks();
38private:
39 void enableVspLayers();
40 void disableVspLayers();
41 void sortLayersByDepth();
42 void recreateVspLayers();
43 friend class Vsp2Layer;
44};
45
47{
48 explicit Vsp2Buffer() = default;
49 explicit Vsp2Buffer(wl_kms_buffer *kmsBuffer);
50
51 int dmabufFd = -1;
55};
56
57class Vsp2Layer : public QObject
58{
60public:
62 void enableVspLayer();
63 void disableVspLayer();
64 bool isEnabled() { return m_layerIndex != -1; }
65 QWaylandQuickHardwareLayer *hwLayer() const { return m_hwLayer; }
66
67public Q_SLOTS:
70 void updatePosition();
71 void updateOpacity();
72
73private:
74 wl_kms_buffer *nextKmsBuffer();
75 int m_layerIndex = -1;
76 QVsp2Screen *m_screen = nullptr;
77 QPoint m_position;
78 QWaylandQuickHardwareLayer *m_hwLayer = nullptr;
79 QWaylandSurface *m_surface = nullptr;
80 Vsp2Buffer m_buffer;
81};
82
83QT_END_NAMESPACE
84
85#endif // VSP2HARDWARELAYERINTEGRATION_H
void add(QWaylandQuickHardwareLayer *layer) override
void remove(QWaylandQuickHardwareLayer *layer) override
QList< QSharedPointer< Vsp2Layer > > m_layers
QWaylandQuickHardwareLayer * hwLayer() const
Vsp2Buffer()=default
Vsp2Buffer(wl_kms_buffer *kmsBuffer)