From 74e7f9ccc5a16103ac0c667ce4b49503b55d377b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 22 Sep 2022 10:44:39 +0200 Subject: 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 (cherry picked from commit 2afb9fe157ff7ead678f1b29f3c2955e277e7d1c) Reviewed-by: Daniel Smith --- src/quickshapes/qquickshapegenericrenderer.cpp | 8 ++++---- 1 file 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(newMaterial); + QQuickShapeRadialGradientMaterial *m = static_cast(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(newMaterial); + QQuickShapeRadialGradientMaterial *m = static_cast(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(newMaterial); + QQuickShapeConicalGradientMaterial *m = static_cast(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(newMaterial); + QQuickShapeConicalGradientMaterial *m = static_cast(newMaterial); QQuickShapeGenericStrokeFillNode *node = m->node(); const QQuickShapeGradientCacheKey cacheKey(node->m_fillGradient.stops, node->m_fillGradient.spread); QSGTexture *t = QQuickShapeGradientCache::cacheForRhi(state.rhi())->get(cacheKey); -- cgit v1.2.3