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
+2012-06-28 Zeev Lieber <zlieber@chromium.org>
+
+ [Skia] Computing the resampling mode ignores scale applied to the canvas
+ https://bugs.webkit.org/show_bug.cgi?id=72073
+
+ Reviewed by Stephen White.
+
+ 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:
+
2012-06-28 Tony Chang <tony@chromium.org>
Split flex into flex-grow/flex-shrink/flex-basis
// Chromium needs larger media files to test buffering this way.
BUGWK88172 SKIP : http/tests/media/video-buffered.html = PASS
+// Remove after rebaselined images are available.
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirRTL-anchorStart.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirLTR-anchorEnd.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirRTL-anchorEnd.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirLTR-anchorStart.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirNone-anchorStart.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirNone-anchorMiddle.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirNone-anchorEnd.svg = IMAGE
+BUGWK72073 MAC WIN : fast/borders/border-image-scale-transform.html = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-SVG-1.1/render-groups-03-t.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-no-markup.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-SVG-1.1/render-groups-01-b.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-SVG-1.1/render-groups-03-t.svg = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-SVG-1.1/struct-symbol-01-b.svg = IMAGE
+BUGWK72073 MAC WIN : svg/carto.net/scrollbar.svg = IMAGE
+BUGWK72073 MAC WIN : svg/custom/image-small-width-height.svg = IMAGE
+BUGWK72073 MAC WIN : svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html = IMAGE
+BUGWK72073 MAC WIN : transitions/cross-fade-background-image.html = IMAGE
+BUGWK72073 MAC WIN : svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart.svg = IMAGE
+
// -----------------------------------------------------------------
// WONTFIX TESTS
// -----------------------------------------------------------------
+2012-06-28 Zeev Lieber <zlieber@chromium.org>
+
+ [Skia] Computing the resampling mode ignores scale applied to the canvas
+ https://bugs.webkit.org/show_bug.cgi?id=72073
+
+ Reviewed by Stephen White.
+
+ 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):
+
2012-06-28 James Robinson <jamesr@chromium.org>
[chromium] Should schedule a commit when dropping contents textures
ResamplingMode resampling;
if (platformContext->isAccelerated())
resampling = RESAMPLE_LINEAR;
- else
- resampling = platformContext->printing() ? RESAMPLE_NONE :
- computeResamplingMode(platformContext, bitmap, srcRect.width(), srcRect.height(), SkScalarToFloat(destRect.width()), SkScalarToFloat(destRect.height()));
+ else if (platformContext->printing())
+ resampling = RESAMPLE_NONE;
+ else {
+ // Take into account scale applied to the canvas when computing sampling mode (e.g. CSS scale or page scale).
+ SkRect destRectTarget = destRect;
+ if (!(canvas->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
+ canvas->getTotalMatrix().mapRect(&destRectTarget, destRect);
+
+ resampling = computeResamplingMode(platformContext, bitmap, srcRect.width(), srcRect.height(),
+ SkScalarToFloat(destRectTarget.width()), SkScalarToFloat(destRectTarget.height()));
+ }
+
if (resampling == RESAMPLE_NONE) {
// FIXME: This is to not break tests (it results in the filter bitmap flag
// being set to true). We need to decide if we respect RESAMPLE_NONE