| 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 QSGFLATCOLORMATERIAL_H |
| 5 | #define QSGFLATCOLORMATERIAL_H |
| 6 | |
| 7 | #include <QtQuick/qsgmaterial.h> |
| 8 | #include <QtGui/qcolor.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | class Q_QUICK_EXPORT QSGFlatColorMaterial : public QSGMaterial |
| 13 | { |
| 14 | public: |
| 15 | QSGFlatColorMaterial(); |
| 16 | QSGMaterialType *type() const override; |
| 17 | QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const override; |
| 18 | |
| 19 | void setColor(const QColor &color); |
| 20 | const QColor &color() const { return m_color; } |
| 21 | |
| 22 | int compare(const QSGMaterial *other) const override; |
| 23 | |
| 24 | private: |
| 25 | QColor m_color; |
| 26 | }; |
| 27 | |
| 28 | QT_END_NAMESPACE |
| 29 | |
| 30 | #endif // FLATCOLORMATERIAL_H |
| 31 | |