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
5#ifndef QSGBASICINTERNALRECTANGLENODE_P_H
6#define QSGBASICINTERNALRECTANGLENODE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qsgadaptationlayer_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class Q_QUICK_EXPORT QSGBasicInternalRectangleNode : public QSGInternalRectangleNode
24{
25public:
26 QSGBasicInternalRectangleNode();
27
28 void setRect(const QRectF &rect) override;
29 void setColor(const QColor &color) override;
30 void setPenColor(const QColor &color) override;
31 void setPenWidth(qreal width) override;
32 void setGradientStops(const QGradientStops &stops) override;
33 void setGradientVertical(bool vertical) override;
34 void setRadius(qreal radius) override;
35 void setTopLeftRadius(qreal radius) override;
36 void setTopRightRadius(qreal radius) override;
37 void setBottomLeftRadius(qreal radius) override;
38 void setBottomRightRadius(qreal radius) override;
39 void setAntialiasing(bool antialiasing) override;
40 void setAligned(bool aligned) override;
41 void update() override;
42
43protected:
44 virtual bool supportsAntialiasing() const { return true; }
45 virtual void updateMaterialAntialiasing() = 0;
46 virtual void updateMaterialBlending(QSGNode::DirtyState *state) = 0;
47
48 void updateGeometry();
49 void updateGradientTexture();
50
51 QRectF m_rect;
52 QGradientStops m_gradient_stops;
53 QColor m_color;
54 QColor m_border_color;
55 float m_radius = 0.0f;
56 float m_topLeftRadius = -1.0f;
57 float m_topRightRadius = -1.0f;
58 float m_bottomLeftRadius = -1.0f;
59 float m_bottomRightRadius = -1.0f;
60 float m_pen_width = 0.0f;
61
62 uint m_aligned : 1;
63 uint m_antialiasing : 1;
64 uint m_gradient_is_opaque : 1;
65 uint m_dirty_geometry : 1;
66 uint m_gradient_is_vertical : 1;
67
68 QSGGeometry m_geometry;
69};
70
71QT_END_NAMESPACE
72
73#endif
74

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtdeclarative/src/quick/scenegraph/qsgbasicinternalrectanglenode_p.h