aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes/qquickshapegenericrenderer_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-02 14:27:13 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-02 15:16:46 +0200
commitb87b3d3d43c200f22f0799ca59ab366d851b5db6 (patch)
treefb8258e0659a91934d2c77c359295da92e4221cd /src/quickshapes/qquickshapegenericrenderer_p.h
parent1f0b3a54ffa2ab0dc0cdff1345980ea68d749d24 (diff)
Make QSGMaterialRhiShader become QSGMaterialShader
After a symbiotic relationship in Qt 5.14 and 5.15, it is time for QSGMaterialRhiShader to devour its older sibling and take its place. This makes the direct OpenGL rendering path disfunctional. All QSGMaterial Qt 6 TODOs are solved, the API is clean and straightforward again: a QSGMaterial creates a QSGMaterialShader, no special flags and options needed. (it's just that QSGMaterialShader now has a slightly different API) Task-number: QTBUG-79268 Task-number: QTBUG-82997 Change-Id: I545ca8d796c5535e81957c706e7832133be15b7d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/quickshapes/qquickshapegenericrenderer_p.h')
-rw-r--r--src/quickshapes/qquickshapegenericrenderer_p.h74
1 files changed, 6 insertions, 68 deletions
diff --git a/src/quickshapes/qquickshapegenericrenderer_p.h b/src/quickshapes/qquickshapegenericrenderer_p.h
index 75c4277383..cb206cea87 100644
--- a/src/quickshapes/qquickshapegenericrenderer_p.h
+++ b/src/quickshapes/qquickshapegenericrenderer_p.h
@@ -243,27 +243,7 @@ public:
static QSGMaterial *createConicalGradient(QQuickWindow *window, QQuickShapeGenericStrokeFillNode *node);
};
-#if QT_CONFIG(opengl)
-
- class QQuickShapeLinearGradientShader : public QSGMaterialShader
-{
-public:
- QQuickShapeLinearGradientShader();
-
- void initialize() override;
- void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;
- char const *const *attributeNames() const override;
-
-private:
- int m_opacityLoc = -1;
- int m_matrixLoc = -1;
- int m_gradStartLoc = -1;
- int m_gradEndLoc = -1;
-};
-
-#endif // QT_CONFIG(opengl)
-
-class QQuickShapeLinearGradientRhiShader : public QSGMaterialRhiShader
+class QQuickShapeLinearGradientRhiShader : public QSGMaterialShader
{
public:
QQuickShapeLinearGradientRhiShader();
@@ -289,7 +269,7 @@ public:
// the vertex data. The shader will rely on the fact that
// vertexCoord.xy is the Shape-space coordinate and so no modifications
// are welcome.
- setFlag(Blending | RequiresFullMatrix | SupportsRhiShader);
+ setFlag(Blending | RequiresFullMatrix);
}
QSGMaterialType *type() const override;
@@ -302,29 +282,7 @@ private:
QQuickShapeGenericStrokeFillNode *m_node;
};
-#if QT_CONFIG(opengl)
-
-class QQuickShapeRadialGradientShader : public QSGMaterialShader
-{
-public:
- QQuickShapeRadialGradientShader();
-
- void initialize() override;
- void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;
- char const *const *attributeNames() const override;
-
-private:
- int m_opacityLoc = -1;
- int m_matrixLoc = -1;
- int m_translationPointLoc = -1;
- int m_focalToCenterLoc = -1;
- int m_centerRadiusLoc = -1;
- int m_focalRadiusLoc = -1;
-};
-
-#endif // QT_CONFIG(opengl)
-
-class QQuickShapeRadialGradientRhiShader : public QSGMaterialRhiShader
+class QQuickShapeRadialGradientRhiShader : public QSGMaterialShader
{
public:
QQuickShapeRadialGradientRhiShader();
@@ -347,7 +305,7 @@ public:
QQuickShapeRadialGradientMaterial(QQuickShapeGenericStrokeFillNode *node)
: m_node(node)
{
- setFlag(Blending | RequiresFullMatrix | SupportsRhiShader);
+ setFlag(Blending | RequiresFullMatrix);
}
QSGMaterialType *type() const override;
@@ -360,27 +318,7 @@ private:
QQuickShapeGenericStrokeFillNode *m_node;
};
-#if QT_CONFIG(opengl)
-
-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;
-
-private:
- int m_opacityLoc = -1;
- int m_matrixLoc = -1;
- int m_angleLoc = -1;
- int m_translationPointLoc = -1;
-};
-
-#endif // QT_CONFIG(opengl)
-
-class QQuickShapeConicalGradientRhiShader : public QSGMaterialRhiShader
+class QQuickShapeConicalGradientRhiShader : public QSGMaterialShader
{
public:
QQuickShapeConicalGradientRhiShader();
@@ -401,7 +339,7 @@ public:
QQuickShapeConicalGradientMaterial(QQuickShapeGenericStrokeFillNode *node)
: m_node(node)
{
- setFlag(Blending | RequiresFullMatrix | SupportsRhiShader);
+ setFlag(Blending | RequiresFullMatrix);
}
QSGMaterialType *type() const override;