Fixed drawImage() so that it doesn't sample outside the source image.
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>
Tue, 28 Jul 2009 07:55:20 +0000 (09:55 +0200)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>
Tue, 28 Jul 2009 08:36:08 +0000 (10:36 +0200)
commitac92e906114ed7216cfd99e0deecfb7be0fd91ec
treefb7d2dd912642eda1a6bba4be2c76f46da832339
parent8cfdb13015a58905539c25334e05492f9afe103b
Fixed drawImage() so that it doesn't sample outside the source image.

In qt_scale_image_16bit() and qt_scale_image_32bit(), when a sample
point was located on the border between two pixels in the source image,
the sample point was rounded up instead of down. If a sample point was
exactly on the bottom or right edge of the source image, the function
would therefore sample a pixel outside the image. Because of how the
target rectangle is rounded, a sample point will never be exactly on
the top or left edge of the source image, so we will not get a similar
problem there.

I extended the lance test pixmap_scaling.qps.

Task-number: 258533
Reviewed-by: Samuel
src/gui/painting/qblendfunctions.cpp
tests/arthur/data/qps/pixmap_scaling.qps