summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2009-09-08 00:35:06 (GMT)
committerSarah Smith <sarah.j.smith@nokia.com>2009-09-08 00:35:06 (GMT)
commit693695e5677422625d555943586d41fbd9dbe971 (patch)
tree17e70dcb11f009398b083cb0361982ca32f2ac6e /src/gui/painting
parentf4fa50c25aea68b7696ad7de289d93facac9f3e5 (diff)
parent4bb098ed9449bd3b2798000bc5394bda98c9165f (diff)
downloadQt-693695e5677422625d555943586d41fbd9dbe971.zip
Qt-693695e5677422625d555943586d41fbd9dbe971.tar.gz
Qt-693695e5677422625d555943586d41fbd9dbe971.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qdrawhelper.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ab192c5..e9b1bd3 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -4953,15 +4953,18 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void *
if (modeSource && coverage == 255) {
// Copy the first texture block
- length = image_width;
+ length = qMin(image_width,length);
+ int tx = x;
while (length) {
int l = qMin(image_width - sx, length);
if (buffer_size < l)
l = buffer_size;
- DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x;
+ DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + tx;
const SRC *src = (SRC*)data->texture.scanLine(sy) + sx;
+
qt_memconvert<DST, SRC>(dest, src, l);
length -= l;
+ tx += l;
sx = 0;
}
@@ -4971,8 +4974,8 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void *
// We are dealing with one block of data
// - More likely to fit in the cache
// - can use memcpy
- int copy_image_width = image_width;
- length = spans->len - image_width;
+ int copy_image_width = qMin(image_width, int(spans->len));
+ length = spans->len - copy_image_width;
DST *src = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x;
DST *dest = src + copy_image_width;
while (copy_image_width < length) {