aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-09-22 10:44:39 +0200
committerDaniel Smith <Daniel.Smith@qt.io>2022-09-27 10:25:47 +0000
commit74e7f9ccc5a16103ac0c667ce4b49503b55d377b (patch)
tree3f060870434a5ceb7f2a1d006bf9cb9cc5c0c65c
parentde518cc61b7e430e2e43b79e1983d315f25c67e4 (diff)
Fix casts in qquickshapegenericrenderer
Works anyway because the data layout (a single m_node member) is the same for all the materials, but let's correct the casts. Fixes: QTBUG-106824 Change-Id: I84038b04ca03339bdefc61d5780b35309fcf6670 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 2afb9fe157ff7ead678f1b29f3c2955e277e7d1c) Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
-rw-r--r--src/quickshapes/qquickshapegenericrenderer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp
index bbbc9b2cd0..c091163f80 100644
--- a/src/quickshapes/qquickshapegenericrenderer.cpp
+++ b/src/quickshapes/qquickshapegenericrenderer.cpp
@@ -843,7 +843,7 @@ bool QQuickShapeRadialGradientRhiShader::updateUniformData(RenderState &state,
QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
{
Q_ASSERT(oldMaterial == nullptr || newMaterial->type() == oldMaterial->type());
- QQuickShapeLinearGradientMaterial *m = static_cast<QQuickShapeLinearGradientMaterial *>(newMaterial);
+ QQuickShapeRadialGradientMaterial *m = static_cast<QQuickShapeRadialGradientMaterial *>(newMaterial);
bool changed = false;
QByteArray *buf = state.uniformData();
Q_ASSERT(buf->size() >= 92);
@@ -903,7 +903,7 @@ void QQuickShapeRadialGradientRhiShader::updateSampledImage(RenderState &state,
if (binding != 1)
return;
- QQuickShapeLinearGradientMaterial *m = static_cast<QQuickShapeLinearGradientMaterial *>(newMaterial);
+ QQuickShapeRadialGradientMaterial *m = static_cast<QQuickShapeRadialGradientMaterial *>(newMaterial);
QQuickShapeGenericStrokeFillNode *node = m->node();
const QQuickShapeGradientCacheKey cacheKey(node->m_fillGradient.stops, node->m_fillGradient.spread);
QSGTexture *t = QQuickShapeGradientCache::cacheForRhi(state.rhi())->get(cacheKey);
@@ -977,7 +977,7 @@ bool QQuickShapeConicalGradientRhiShader::updateUniformData(RenderState &state,
QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
{
Q_ASSERT(oldMaterial == nullptr || newMaterial->type() == oldMaterial->type());
- QQuickShapeLinearGradientMaterial *m = static_cast<QQuickShapeLinearGradientMaterial *>(newMaterial);
+ QQuickShapeConicalGradientMaterial *m = static_cast<QQuickShapeConicalGradientMaterial *>(newMaterial);
bool changed = false;
QByteArray *buf = state.uniformData();
Q_ASSERT(buf->size() >= 80);
@@ -1021,7 +1021,7 @@ void QQuickShapeConicalGradientRhiShader::updateSampledImage(RenderState &state,
if (binding != 1)
return;
- QQuickShapeLinearGradientMaterial *m = static_cast<QQuickShapeLinearGradientMaterial *>(newMaterial);
+ QQuickShapeConicalGradientMaterial *m = static_cast<QQuickShapeConicalGradientMaterial *>(newMaterial);
QQuickShapeGenericStrokeFillNode *node = m->node();
const QQuickShapeGradientCacheKey cacheKey(node->m_fillGradient.stops, node->m_fillGradient.spread);
QSGTexture *t = QQuickShapeGradientCache::cacheForRhi(state.rhi())->get(cacheKey);