aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/shapes/qquickshapegenericrenderer_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/shapes/qquickshapegenericrenderer_p.h')
-rw-r--r--src/imports/shapes/qquickshapegenericrenderer_p.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/src/imports/shapes/qquickshapegenericrenderer_p.h b/src/imports/shapes/qquickshapegenericrenderer_p.h
index 2561116f81..32cec798ec 100644
--- a/src/imports/shapes/qquickshapegenericrenderer_p.h
+++ b/src/imports/shapes/qquickshapegenericrenderer_p.h
@@ -210,7 +210,8 @@ public:
enum Material {
MatSolidColor,
MatLinearGradient,
- MatRadialGradient
+ MatRadialGradient,
+ MatConicalGradient
};
void activateMaterial(Material m);
@@ -242,6 +243,7 @@ public:
static QSGMaterial *createVertexColor(QQuickWindow *window);
static QSGMaterial *createLinearGradient(QQuickWindow *window, QQuickShapeGenericStrokeFillNode *node);
static QSGMaterial *createRadialGradient(QQuickWindow *window, QQuickShapeGenericStrokeFillNode *node);
+ static QSGMaterial *createConicalGradient(QQuickWindow *window, QQuickShapeGenericStrokeFillNode *node);
};
#if QT_CONFIG(opengl)
@@ -343,6 +345,51 @@ private:
QQuickShapeGenericStrokeFillNode *m_node;
};
+class QQuickShapeConicalGradientShader : public QSGMaterialShader
+{
+public:
+ QQuickShapeConicalGradientShader();
+
+ void initialize() override;
+ void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;
+ char const *const *attributeNames() const override;
+
+ static QSGMaterialType type;
+
+private:
+ int m_opacityLoc = -1;
+ int m_matrixLoc = -1;
+ int m_angleLoc = -1;
+ int m_translationPointLoc = -1;
+};
+
+class QQuickShapeConicalGradientMaterial : public QSGMaterial
+{
+public:
+ QQuickShapeConicalGradientMaterial(QQuickShapeGenericStrokeFillNode *node)
+ : m_node(node)
+ {
+ setFlag(Blending | RequiresFullMatrix);
+ }
+
+ QSGMaterialType *type() const override
+ {
+ return &QQuickShapeConicalGradientShader::type;
+ }
+
+ int compare(const QSGMaterial *other) const override;
+
+ QSGMaterialShader *createShader() const override
+ {
+ return new QQuickShapeConicalGradientShader;
+ }
+
+ QQuickShapeGenericStrokeFillNode *node() const { return m_node; }
+
+private:
+ QQuickShapeGenericStrokeFillNode *m_node;
+};
+
#endif // QT_CONFIG(opengl)
QT_END_NAMESPACE