summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2016-10-21 18:28:55 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-03 12:54:52 +0000
commit9e53a91e99accae299ff7b4cc0a9c3675606d688 (patch)
treef199cf7e587113132941daa80adbf09a2b393d16 /src/gui
parentca4d93d85ee446c5e30ec8e7814651e45cbf1218 (diff)
Fix tiling on a width over 2048
The blend_tiled_argb and blend_tiled_rgb565 was not correctly handling widths larger than the buffer size. This patch adds the same pattern used in blend_tiled_generic, which worked correctly. Change-Id: Ie22c2a21d96cb0477cd0990bf01451ab907a4768 Task-number: QTBUG-56364 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qdrawhelper.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 39ff4142b8..c0a662b002 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -4509,8 +4509,10 @@ static void blend_tiled_argb(int count, const QSpan *spans, void *userData)
uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x;
op.func(dest, src, l, coverage);
x += l;
+ sx += l;
length -= l;
- sx = 0;
+ if (sx >= image_width)
+ sx = 0;
}
++spans;
}
@@ -4568,7 +4570,9 @@ static void blend_tiled_rgb565(int count, const QSpan *spans, void *userData)
memcpy(dest, src, l * sizeof(quint16));
length -= l;
tx += l;
- sx = 0;
+ sx += l;
+ if (sx >= image_width)
+ sx = 0;
}
// Now use the rasterBuffer as the source of the texture,
@@ -4601,8 +4605,10 @@ static void blend_tiled_rgb565(int count, const QSpan *spans, void *userData)
const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx;
blend_sourceOver_rgb16_rgb16(dest, src, l, alpha, ialpha);
x += l;
+ sx += l;
length -= l;
- sx = 0;
+ if (sx >= image_width)
+ sx = 0;
}
}
}