| 1 | // Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> |
|---|---|
| 2 | // Copyright (C) 2016 The Qt Company Ltd. |
| 3 | // Copyright (C) 2016 Pelagicore AG |
| 4 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 5 | |
| 6 | #ifndef QEGLFSKMSINTEGRATION_H |
| 7 | #define QEGLFSKMSINTEGRATION_H |
| 8 | |
| 9 | // |
| 10 | // W A R N I N G |
| 11 | // ------------- |
| 12 | // |
| 13 | // This file is not part of the Qt API. It exists purely as an |
| 14 | // implementation detail. This header file may change from version to |
| 15 | // version without notice, or even be removed. |
| 16 | // |
| 17 | // We mean it. |
| 18 | // |
| 19 | |
| 20 | #include "private/qeglfsdeviceintegration_p.h" |
| 21 | #include <QtCore/QMap> |
| 22 | #include <QtCore/QVariant> |
| 23 | #include <QtCore/QLoggingCategory> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | class QKmsDevice; |
| 28 | class QKmsScreenConfig; |
| 29 | |
| 30 | Q_DECLARE_EXPORTED_LOGGING_CATEGORY(qLcEglfsKmsDebug, Q_EGLFS_EXPORT) |
| 31 | |
| 32 | class Q_EGLFS_EXPORT QEglFSKmsIntegration : public QEglFSDeviceIntegration |
| 33 | { |
| 34 | public: |
| 35 | QEglFSKmsIntegration(); |
| 36 | ~QEglFSKmsIntegration(); |
| 37 | |
| 38 | void platformInit() override; |
| 39 | void platformDestroy() override; |
| 40 | EGLNativeDisplayType platformDisplay() const override; |
| 41 | bool usesDefaultScreen() override; |
| 42 | void screenInit() override; |
| 43 | QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const override; |
| 44 | bool hasCapability(QPlatformIntegration::Capability cap) const override; |
| 45 | void waitForVSync(QPlatformSurface *surface) const override; |
| 46 | bool supportsPBuffers() const override; |
| 47 | void *nativeResourceForIntegration(const QByteArray &name) override; |
| 48 | void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; |
| 49 | |
| 50 | QKmsDevice *device() const; |
| 51 | QKmsScreenConfig *screenConfig() const; |
| 52 | |
| 53 | protected: |
| 54 | virtual QKmsDevice *createDevice() = 0; |
| 55 | virtual QKmsScreenConfig *createScreenConfig(); |
| 56 | |
| 57 | QKmsDevice *m_device; |
| 58 | QKmsScreenConfig *m_screenConfig = nullptr; |
| 59 | }; |
| 60 | |
| 61 | QT_END_NAMESPACE |
| 62 | |
| 63 | #endif |
| 64 |
