[Qt] Images are down-scaled badly

https://bugs.webkit.org/show_bug.cgi?id=119263

Reviewed by Jocelyn Turcotte.

QPainter only does bilinear filtering, which means it will downscaling beyond
0.5x will start skipping pixel and start to degrade the end result. Scaling in
QImage and QPixmap however uses a better but much more expensive sampling that
counts all pixels.

To get the high quality downscaling we must therefore prescale the images before
painting them. To avoid a performance impact on repeated paints the prescaled
image are saved in the QPixmapCache.

* platform/graphics/qt/ImageQt.cpp:
(WebCore::BitmapImage::draw):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153522 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Task-number: QTBUG-30155
Change-Id: I8b07de1d7415bc4e2dea565df92739e3ff2014b4
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
[Qt] REGRESSION(r) Two pixel result fail after r153522

https://bugs.webkit.org/show_bug.cgi?id=119392

Reviewed by Jocelyn Turcotte.

Consider scaling transform on the painter to determine final destination size.

Covered by existing tests.

* platform/graphics/qt/ImageQt.cpp:
(WebCore::prescaleImageIfRequired):
(WebCore::BitmapImage::draw):

Change-Id: I631e0925abaf814c95f709c18919f127c8b41503
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>