[Skia] Computing the resampling mode ignores scale applied to the canvas
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2012 19:37:20 +0000 (19:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2012 19:37:20 +0000 (19:37 +0000)
commit6d062c84a9840c8f79bdbe31f3a4d4f9c1fd1af8
treecfa7b6f77dd8975f83bca17992d655d6a4206bd7
parent96e4983da36b358d0c8a757a1e86fd552357a5cd
[Skia] Computing the resampling mode ignores scale applied to the canvas
https://bugs.webkit.org/show_bug.cgi?id=72073

Patch by Zeev Lieber <zlieber@chromium.org> on 2012-06-28
Reviewed by Stephen White.

Source/WebCore:

Re-basing earlier patch by Daniel Sievers; updated tests.

Take into account canvas scale when computing image resampling mode.

When drawing a bitmap and computing the best resampling mode based
on the requested scale, take into account CSS scale and page scale
that are applied to the canvas. This allows for single-pass scaling
in potentially better quality (RESAMPLE_AWESOME) and also takes
better advantage of the scaled image cache in that codepath.

Existing tests updated to expect different resampling method (and
therefore a different image) whenever canvas scaling changes.

* platform/graphics/skia/ImageSkia.cpp:
(WebCore::paintSkBitmap):

LayoutTests:

Updated tests to expect different image when resampling method changed.

* platform/chromium-linux/fast/borders/border-image-scale-transform-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirLTR-anchorEnd-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirLTR-anchorStart-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirNone-anchorEnd-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirNone-anchorMiddle-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirNone-anchorStart-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirRTL-anchorEnd-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-dirRTL-anchorStart-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart-expected.png:
* platform/chromium-linux/svg/W3C-I18N/text-anchor-no-markup-expected.png:
* platform/chromium-linux/svg/W3C-SVG-1.1/render-groups-01-b-expected.png:
* platform/chromium-linux/svg/W3C-SVG-1.1/render-groups-03-t-expected.png:
* platform/chromium-linux/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.png:
* platform/chromium-linux/svg/carto.net/scrollbar-expected.png:
* platform/chromium-linux/svg/custom/image-small-width-height-expected.png:
* platform/chromium-linux/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.png:
* platform/chromium-linux/transitions/cross-fade-background-image-expected.png:
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/fast/borders/border-image-scale-transform-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirLTR-anchorEnd-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirLTR-anchorStart-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirNone-anchorEnd-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirNone-anchorMiddle-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirNone-anchorStart-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirRTL-anchorEnd-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-dirRTL-anchorStart-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-I18N/text-anchor-no-markup-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-SVG-1.1/render-groups-01-b-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-SVG-1.1/render-groups-03-t-expected.png
LayoutTests/platform/chromium-linux/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.png
LayoutTests/platform/chromium-linux/svg/carto.net/scrollbar-expected.png
LayoutTests/platform/chromium-linux/svg/custom/image-small-width-height-expected.png
LayoutTests/platform/chromium-linux/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.png
LayoutTests/platform/chromium-linux/transitions/cross-fade-background-image-expected.png
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/skia/ImageSkia.cpp