Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgbasicinternalrectanglenode_p.h
Go to the documentation of this file.
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
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 resetTopLeftRadius() override;
40 void resetTopRightRadius() override;
41 void resetBottomLeftRadius() override;
42 void resetBottomRightRadius() override;
43 void setAntialiasing(bool antialiasing) override;
44 void setAligned(bool aligned) override;
45 void update() override;
46
47protected:
48 virtual bool supportsAntialiasing() const { return true; }
49 virtual void updateMaterialAntialiasing() = 0;
50 virtual void updateMaterialBlending(QSGNode::DirtyState *state) = 0;
51
52 void updateGeometry();
53 void updateGradientTexture();
54
55 QRectF m_rect;
56 QGradientStops m_gradient_stops;
57 QColor m_color;
58 QColor m_border_color;
59 float m_radius = 0.0f;
60 float m_topLeftRadius = 0.0f;
61 float m_topRightRadius = 0.0f;
62 float m_bottomLeftRadius = 0.0f;
63 float m_bottomRightRadius = 0.0f;
64 float m_pen_width = 0.0f;
65
66 uint m_aligned : 1;
67 uint m_antialiasing : 1;
68 uint m_gradient_is_opaque : 1;
69 uint m_dirty_geometry : 1;
70 uint m_gradient_is_vertical : 1;
71
72 uint m_isTopLeftRadiusSet : 1;
73 uint m_isTopRightRadiusSet : 1;
74 uint m_isBottomLeftRadiusSet : 1;
75 uint m_isBottomRightRadiusSet : 1;
76
77 QSGGeometry m_geometry;
78};
79
80QT_END_NAMESPACE
81
82#endif
const QSGGeometry::AttributeSet & smoothAttributeSet()
Color4ub colorToColor4ub(const QColor &c)
Color4ub operator*(Color4ub c, float t)
Color4ub operator+(Color4ub a, Color4ub b)
void set(float primary, float secondary, Color4ub ncolor, float dPrimary, float dSecondary, bool vertical)
void set(float primary, float secondary, Color4ub ncolor, bool vertical)