summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-09-22 17:04:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-09-23 17:14:53 +0000
commitd95cb94baa6302bea6ad57a9690453e9b618421e (patch)
tree2e1d7a2fee57262a918273ebfc15201714c086d9 /src/gui
parent55f4957cb8de2603d7a6bcaae442aac9db55fbf9 (diff)
Fix linear RGB16 gradients
Writing to solid overwrites part of the gradient input messing up later lines. In particular repeating gradients tended to be broken. Tested by lancelot (once the baseline is correct). Change-Id: I64222048ba67b0424b44822f09ddc947973145a6 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qdrawhelper.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ee3863ceb8..39ff4142b8 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -5638,15 +5638,16 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)
int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);
int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));
- QRgba64 oldColor = data->solid.color;
+ // Save the fillData since we overwrite it when setting solid.color.
+ QGradientData gradient = data->gradient;
while (count--) {
int y = spans->y;
- data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off));
+ data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off));
blend_color_rgb16(1, spans, userData);
++spans;
}
- data->solid.color = oldColor;
+ data->gradient = gradient;
} else {
blend_src_generic(count, spans, userData);