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 QSGSOFTWAREINTERNALRECTANGLENODE_H
5#define QSGSOFTWAREINTERNALRECTANGLENODE_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 <private/qsgadaptationlayer_p.h>
19
20#include <QPen>
21#include <QBrush>
22#include <QPixmap>
23
24QT_BEGIN_NAMESPACE
25
26class QSGSoftwareInternalRectangleNode : public QSGInternalRectangleNode
27{
28public:
29 QSGSoftwareInternalRectangleNode();
30
31 void setRect(const QRectF &rect) override;
32 void setColor(const QColor &color) override;
33 void setPenColor(const QColor &color) override;
34 void setPenWidth(qreal width) override;
35 void setGradientStops(const QGradientStops &stops) override;
36 void setGradientVertical(bool vertical) override;
37 void setRadius(qreal radius) override;
38 void setAntialiasing(bool antialiasing) override { Q_UNUSED(antialiasing); }
39 void setAligned(bool aligned) override;
40
41 void update() override;
42
43 void paint(QPainter *);
44
45 bool isOpaque() const;
46 QRectF rect() const;
47private:
48 void paintRectangle(QPainter *painter, const QRect &rect);
49 void generateCornerPixmap();
50
51 QRect m_rect;
52 QColor m_color;
53 QColor m_penColor;
54 double m_penWidth;
55 QGradientStops m_stops;
56 double m_radius;
57 QPen m_pen;
58 QBrush m_brush;
59 bool m_vertical;
60
61 bool m_cornerPixmapIsDirty;
62 QPixmap m_cornerPixmap;
63
64 qreal m_devicePixelRatio;
65};
66
67QT_END_NAMESPACE
68
69#endif // QSGSOFTWAREINTERNALRECTANGLENODE_H
70

source code of qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode_p.h