| 1 | // Copyright (C) 2017 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 QPLATFORMSURFACE_H |
| 5 | #define QPLATFORMSURFACE_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is part of the QPA API and is not meant to be used |
| 12 | // in applications. Usage of this API may make your code |
| 13 | // source and binary incompatible with future versions of Qt. |
| 14 | // |
| 15 | |
| 16 | #include <QtGui/qtguiglobal.h> |
| 17 | #include <QtCore/qnamespace.h> |
| 18 | #include <QtGui/qsurface.h> |
| 19 | #include <QtGui/qsurfaceformat.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | class QPlatformScreen; |
| 24 | |
| 25 | #ifndef QT_NO_DEBUG_STREAM |
| 26 | class QDebug; |
| 27 | #endif |
| 28 | |
| 29 | class Q_GUI_EXPORT QPlatformSurface |
| 30 | { |
| 31 | public: |
| 32 | Q_DISABLE_COPY_MOVE(QPlatformSurface) |
| 33 | |
| 34 | virtual ~QPlatformSurface(); |
| 35 | virtual QSurfaceFormat format() const = 0; |
| 36 | |
| 37 | QSurface *surface() const; |
| 38 | virtual QPlatformScreen *screen() const = 0; |
| 39 | |
| 40 | static bool isRasterSurface(QSurface *surface); |
| 41 | |
| 42 | private: |
| 43 | explicit QPlatformSurface(QSurface *surface); |
| 44 | |
| 45 | QSurface *m_surface; |
| 46 | |
| 47 | friend class QPlatformWindow; |
| 48 | friend class QPlatformOffscreenSurface; |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | #ifndef QT_NO_DEBUG_STREAM |
| 53 | Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QPlatformSurface *surface); |
| 54 | #endif |
| 55 | |
| 56 | QT_END_NAMESPACE |
| 57 | |
| 58 | #endif //QPLATFORMSURFACE_H |
| 59 | |