From 4f2c5aa8970958b333998ad841d9162a5bfee644 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 29 Mar 2017 13:37:56 +0200 Subject: PathItem/generic: Fix spread modes in gradient material Not including the mode in the comparison makes the scenegraph think that two Pathitems with two linear gradients that only differ in the spread mode can reuse the same material. That would be wrong. Change-Id: I34ad1b74ec8f98ec3a11d6a2565e0a7e5ae3673a Reviewed-by: Andy Nichols --- src/quick/items/qquickpathitemgenericrenderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quick') diff --git a/src/quick/items/qquickpathitemgenericrenderer.cpp b/src/quick/items/qquickpathitemgenericrenderer.cpp index 7a259617dd..4e8fe55df2 100644 --- a/src/quick/items/qquickpathitemgenericrenderer.cpp +++ b/src/quick/items/qquickpathitemgenericrenderer.cpp @@ -744,6 +744,10 @@ int QQuickPathItemLinearGradientMaterial::compare(const QSGMaterial *other) cons const QQuickPathItemGradientCache::GradientDesc *ga = &a->m_fillGradient; const QQuickPathItemGradientCache::GradientDesc *gb = &b->m_fillGradient; + + if (int d = ga->spread - gb->spread) + return d; + if (int d = ga->start.x() - gb->start.x()) return d; if (int d = ga->start.y() - gb->start.y()) -- cgit v1.2.3