aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-03-29 13:37:56 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-03-30 09:29:25 +0000
commit4f2c5aa8970958b333998ad841d9162a5bfee644 (patch)
tree2429d45ae9efe53fcf7049b7c407cee84b2580d2 /src/quick
parent1c834f1d6bfe78ba30f4ee733a65b43029632df9 (diff)
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 <andy.nichols@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickpathitemgenericrenderer.cpp4
1 files changed, 4 insertions, 0 deletions
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())