summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-04-20 07:49:39 (GMT)
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-04-20 08:03:37 (GMT)
commitd738414926bc575a37c6ae6c6cca68d01439b2ef (patch)
tree63504521bfa180b868b8d507f113a1b57bc4e10b /src
parentd97c42b7fdb4b370ec5a09ef5d6f04e2e22f241d (diff)
downloadQt-d738414926bc575a37c6ae6c6cca68d01439b2ef.zip
Qt-d738414926bc575a37c6ae6c6cca68d01439b2ef.tar.gz
Qt-d738414926bc575a37c6ae6c6cca68d01439b2ef.tar.bz2
Fixed pixel-bleeding when stretching subrected pixmaps.
When stretching a subrect of a pixmap we need to clamp the sampling to the subrect. This was done for the ARGB32_Premultiplied target format but not for the generic fallback. This patch adapts the code so that the two code paths are equivalent. Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qdrawhelper.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index b440fce..bfa1136 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -674,6 +674,11 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
int image_width = data->texture.width;
int image_height = data->texture.height;
+ int image_x1 = data->texture.x1;
+ int image_y1 = data->texture.y1;
+ int image_x2 = data->texture.x2;
+ int image_y2 = data->texture.y2;
+
const qreal cx = x + 0.5;
const qreal cy = y + 0.5;
@@ -708,17 +713,17 @@ const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *
y2 = y1 + 1;
y2 %= image_height;
} else {
- if (x1 < 0) {
- x2 = x1 = 0;
- } else if (x1 >= image_width - 1) {
- x2 = x1 = image_width - 1;
+ if (x1 < image_x1) {
+ x2 = x1 = image_x1;
+ } else if (x1 >= image_x2 - 1) {
+ x2 = x1 = image_x2 - 1;
} else {
x2 = x1 + 1;
}
- if (y1 < 0) {
- y2 = y1 = 0;
- } else if (y1 >= image_height - 1) {
- y2 = y1 = image_height - 1;
+ if (y1 < image_y1) {
+ y2 = y1 = image_y1;
+ } else if (y1 >= image_y2 - 1) {
+ y2 = y1 = image_y2 - 1;
} else {
y2 = y1 + 1;
}