[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 16:15:57 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 16dfa4476ec646aebcf4c36d65918c065b936535
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 20 07:56:22 2010 +0000

    2010-11-19  W. James MacLean  <wjmaclean at chromium.org>
    
            Reviewed by James Robinson.
    
            Scaled Resized images are blurred when sent to Skia
            https://bugs.webkit.org/show_bug.cgi?id=42370
    
            * platform/chromium-linux/svg/custom/image-rescale-expected.checksum: Added.
            * platform/chromium-linux/svg/custom/image-rescale-expected.png: Added.
            * platform/chromium-linux/svg/custom/image-rescale-expected.txt: Added.
            * platform/chromium-linux/svg/custom/image-rescale-scroll-expected.checksum: Added.
            * platform/chromium-linux/svg/custom/image-rescale-scroll-expected.png: Added.
            * platform/chromium-linux/svg/custom/image-rescale-scroll-expected.txt: Added.
            * platform/chromium/test_expectations.txt:
            * platform/mac/svg/custom/image-rescale-expected.checksum: Added.
            * platform/mac/svg/custom/image-rescale-expected.png: Added.
            * platform/mac/svg/custom/image-rescale-expected.txt: Added.
            * platform/mac/svg/custom/image-rescale-scroll-expected.checksum: Added.
            * platform/mac/svg/custom/image-rescale-scroll-expected.png: Added.
            * platform/mac/svg/custom/image-rescale-scroll-expected.txt: Added.
            * platform/mac/test_expectations.txt:
            * svg/custom/image-rescale-scroll.html: Added.
            * svg/custom/image-rescale.svg: Added.
            * svg/custom/resources/image-rescale.jpg: Added.
    2010-11-19  W. James MacLean  <wjmaclean at chromium.org>
    
            Reviewed by James Robinson.
    
            Scaled Resized images are blurred when sent to Skia
            https://bugs.webkit.org/show_bug.cgi?id=42370
    
            This patch modifies ImageSkia.cpp to fix the calculation of resampled
            bitmap sizes so as to include the transform matrix of the canvas.
            Includes a new test to catch a regression that occured the first time
            this patch was applied.
    
            Tests: svg/custom/image-rescale-scroll.html
                   svg/custom/image-rescale.svg
    
            * platform/graphics/skia/ImageSkia.cpp:
            (WebCore::computeResamplingMode):
            (WebCore::drawResampledBitmap):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72470 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3ef3c8b..e241c42 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,28 @@
+2010-11-19  W. James MacLean  <wjmaclean at chromium.org>
+
+        Reviewed by James Robinson.
+
+        Scaled Resized images are blurred when sent to Skia
+        https://bugs.webkit.org/show_bug.cgi?id=42370
+
+        * platform/chromium-linux/svg/custom/image-rescale-expected.checksum: Added.
+        * platform/chromium-linux/svg/custom/image-rescale-expected.png: Added.
+        * platform/chromium-linux/svg/custom/image-rescale-expected.txt: Added.
+        * platform/chromium-linux/svg/custom/image-rescale-scroll-expected.checksum: Added.
+        * platform/chromium-linux/svg/custom/image-rescale-scroll-expected.png: Added.
+        * platform/chromium-linux/svg/custom/image-rescale-scroll-expected.txt: Added.
+        * platform/chromium/test_expectations.txt:
+        * platform/mac/svg/custom/image-rescale-expected.checksum: Added.
+        * platform/mac/svg/custom/image-rescale-expected.png: Added.
+        * platform/mac/svg/custom/image-rescale-expected.txt: Added.
+        * platform/mac/svg/custom/image-rescale-scroll-expected.checksum: Added.
+        * platform/mac/svg/custom/image-rescale-scroll-expected.png: Added.
+        * platform/mac/svg/custom/image-rescale-scroll-expected.txt: Added.
+        * platform/mac/test_expectations.txt:
+        * svg/custom/image-rescale-scroll.html: Added.
+        * svg/custom/image-rescale.svg: Added.
+        * svg/custom/resources/image-rescale.jpg: Added.
+
 2010-11-19  Jia Pu  <jpu at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/platform/chromium-win/svg/custom/image-rescale-expected.checksum b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-expected.checksum
similarity index 100%
copy from LayoutTests/platform/chromium-win/svg/custom/image-rescale-expected.checksum
copy to LayoutTests/platform/chromium-linux/svg/custom/image-rescale-expected.checksum
diff --git a/LayoutTests/platform/gtk/svg/custom/image-rescale-expected.txt b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-expected.txt
similarity index 100%
copy from LayoutTests/platform/gtk/svg/custom/image-rescale-expected.txt
copy to LayoutTests/platform/chromium-linux/svg/custom/image-rescale-expected.txt
diff --git a/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.checksum b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.checksum
new file mode 100644
index 0000000..fb0d05d
--- /dev/null
+++ b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.checksum
@@ -0,0 +1 @@
+2e7c0b5776e8cb5e7d5cc68dbf9b483c
\ No newline at end of file
diff --git a/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.png b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.png
new file mode 100644
index 0000000..f344e73
Binary files /dev/null and b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.png differ
diff --git a/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.txt b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.txt
new file mode 100644
index 0000000..de0d8ce
--- /dev/null
+++ b/LayoutTests/platform/chromium-linux/svg/custom/image-rescale-scroll-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x685
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {P} at (0,0) size 784x20
+        RenderText {#text} at (0,0) size 520x19
+          text run at (0,0) width 520: "This test verifies correct repaint of scrolled/re-painted-after-uncovering, scaled images."
+      RenderBlock {P} at (0,36) size 784x40
+        RenderText {#text} at (0,0) size 772x39
+          text run at (0,0) width 533: "If successful, the image below extends past the bottom of the window, with no white bar "
+          text run at (533,0) width 239: "occluding the part of the image adjacent"
+          text run at (0,20) width 175: "to the bottom of the window."
+layer at (50,580) size 160x105
+  RenderImage {IMG} at (50,580) size 160x105
+layer at (0,600) size 300x10
+  RenderBlock (positioned) {DIV} at (0,600) size 300x10 [bgcolor=#FFFFFF]
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index e830726..361a3b6 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -895,6 +895,10 @@ BUGWK44514 LINUX WIN : svg/custom/missing-xlink.svg = TEXT
 // Also fail since WK roll 65859:65885
 BUGWK44514 MAC : fast/backgrounds/svg-as-background-6.html = IMAGE
 
+// May require re-baseline.
+BUGWK42370 WIN MAC : svg/custom/image-rescale.svg = FAIL
+BUGWK42370 WIN MAC : svg/custom/image-rescale-scroll.html = FAIL
+
 // -----------------------------------------------------------------
 // End SVG Regressions
 // -----------------------------------------------------------------
diff --git a/LayoutTests/platform/mac/svg/custom/image-rescale-expected.checksum b/LayoutTests/platform/mac/svg/custom/image-rescale-expected.checksum
new file mode 100644
index 0000000..ef327c4
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/image-rescale-expected.checksum
@@ -0,0 +1 @@
+917ccc88f3cfe6f2d9117e035758a8ce
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/image-rescale-expected.png b/LayoutTests/platform/mac/svg/custom/image-rescale-expected.png
new file mode 100644
index 0000000..0f4f811
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/image-rescale-expected.png differ
diff --git a/LayoutTests/platform/gtk/svg/custom/image-rescale-expected.txt b/LayoutTests/platform/mac/svg/custom/image-rescale-expected.txt
similarity index 100%
copy from LayoutTests/platform/gtk/svg/custom/image-rescale-expected.txt
copy to LayoutTests/platform/mac/svg/custom/image-rescale-expected.txt
diff --git a/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.checksum b/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.checksum
new file mode 100644
index 0000000..d0184e5
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.checksum
@@ -0,0 +1 @@
+7757b91bc39a46e961722697f104353a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.png b/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.png
new file mode 100644
index 0000000..7475725
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.txt b/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.txt
new file mode 100644
index 0000000..d22d1c7
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/image-rescale-scroll-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x685
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 542x18
+          text run at (0,0) width 542: "This test verifies correct repaint of scrolled/re-painted-after-uncovering, scaled images."
+      RenderBlock {P} at (0,34) size 784x36
+        RenderText {#text} at (0,0) size 756x36
+          text run at (0,0) width 561: "If successful, the image below extends past the bottom of the window, with no white bar "
+          text run at (561,0) width 195: "occluding the part of the image"
+          text run at (0,18) width 239: "adjacent to the bottom of the window."
+layer at (50,580) size 160x105
+  RenderImage {IMG} at (50,580) size 160x105
+layer at (0,600) size 300x10
+  RenderBlock (positioned) {DIV} at (0,600) size 300x10 [bgcolor=#FFFFFF]
diff --git a/LayoutTests/platform/mac/test_expectations.txt b/LayoutTests/platform/mac/test_expectations.txt
index 34e12da..53ccb72 100644
--- a/LayoutTests/platform/mac/test_expectations.txt
+++ b/LayoutTests/platform/mac/test_expectations.txt
@@ -97,6 +97,8 @@ BUG36620 : fast/text/stroking.html = IMAGE
 BUG36620 : media/audio-controls-rendering.html = IMAGE
 BUG36620 : transforms/2d/hindi-rotated.html = IMAGE
 
+// Needs re-baselining.
+BUG42370 : svg/custom/image-rescale-scroll.html = FAIL
 
 // These fail depending on order due to interactions with previous tests:
 BUG35006 : fast/dom/global-constructors.html = PASS TEXT
diff --git a/LayoutTests/svg/custom/image-rescale-scroll.html b/LayoutTests/svg/custom/image-rescale-scroll.html
new file mode 100644
index 0000000..b4ccd0a
--- /dev/null
+++ b/LayoutTests/svg/custom/image-rescale-scroll.html
@@ -0,0 +1,43 @@
+<html>
+<!--
+This test checks for the regression bug that causes white, horizontal blank bars
+to occur when scrolling scaled images in Chromium. Since test_shell implements scrolling
+differently than Chrome, we simulate scrolling by occluding part of the image, and
+verifying it repaints correctly when the occlusion is removed. The image must straddle
+the bottom edge of the window with no more than about 20% visible in order to force
+ImageSkia to do a partial load, as this is a precondition of the regression.
+-->
+<script type='text/javascript'>
+
+  function doScroll()
+  {
+    // Remove occlusion after initial page draw.
+    var occluder = document.getElementById('occluder');
+    occluder.style.top = 600;
+
+    if (window.layoutTestController)
+      layoutTestController.notifyDone();
+  }
+
+  if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+</script>
+<body onLoad="doScroll();" style="overflow:hidden;">
+<p>This test verifies correct repaint of scrolled/re-painted-after-uncovering, scaled images.</p>
+<p>If successful, the image below extends past the bottom of the window, with no white bar
+   occluding the part of the image adjacent to the bottom of the window.</p>
+<!-- It is important for the image to be loaded with only a small amount showing,
+     as ImageSkia will only do a partial load in this case, which is required to
+     trigger the regression. -->
+<img id = "pic" src="resources/image-rescale.jpg" width="160" height="105"
+    style="position: absolute; left: 50px; top:580px"
+    > <!-- Rescaled to 1/2 normal size, required to trigger the regression. -->
+
+<!-- The div below occludes part of the image. It is removed shortly after the
+     document has loaded, but if the regression is present the image will not
+     repaint correctly. -->
+<div id="occluder" style="position:absolute; left:0px; top:590px; width:300px; height:10px; background:white;"></div>
+</body>
+</html>
+
diff --git a/LayoutTests/svg/custom/image-rescale.svg b/LayoutTests/svg/custom/image-rescale.svg
new file mode 100644
index 0000000..e274b70
--- /dev/null
+++ b/LayoutTests/svg/custom/image-rescale.svg
@@ -0,0 +1,8 @@
+<svg version="1.1"
+     xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     id="drawingArea-layers" width="700" height="400" >
+     <image  x="0" y="0" width="320" height="210" xlink:href="resources/image-rescale.jpg" />
+     <image  x="350" y="0" width="32.0" height="21.0" transform="translate(350 0) scale(10) translate(-350 0)"
+             xlink:href="resources/image-rescale.jpg" />
+</svg>
diff --git a/LayoutTests/svg/custom/resources/image-rescale.jpg b/LayoutTests/svg/custom/resources/image-rescale.jpg
new file mode 100644
index 0000000..a827f37
Binary files /dev/null and b/LayoutTests/svg/custom/resources/image-rescale.jpg differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2b8e3c6..3aca0c3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-11-19  W. James MacLean  <wjmaclean at chromium.org>
+
+        Reviewed by James Robinson.
+
+        Scaled Resized images are blurred when sent to Skia
+        https://bugs.webkit.org/show_bug.cgi?id=42370
+
+        This patch modifies ImageSkia.cpp to fix the calculation of resampled
+        bitmap sizes so as to include the transform matrix of the canvas.
+        Includes a new test to catch a regression that occured the first time
+        this patch was applied.
+
+        Tests: svg/custom/image-rescale-scroll.html
+               svg/custom/image-rescale.svg
+
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::computeResamplingMode):
+        (WebCore::drawResampledBitmap):
+
 2010-11-19  Jia Pu  <jpu at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index ae2653a..fee64ca 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -143,7 +143,9 @@ static ResamplingMode computeResamplingMode(PlatformContextSkia* platformContext
 
     // Everything else gets resampled.
     // If the platform context permits high quality interpolation, use it.
-    if (platformContext->interpolationQuality() == InterpolationHigh)
+    // High quality interpolation only enabled for scaling and translation.
+    if (platformContext->interpolationQuality() == InterpolationHigh
+        && !(platformContext->canvas()->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
         return RESAMPLE_AWESOME;
     
     return RESAMPLE_LINEAR;
@@ -178,9 +180,17 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
     SkIRect resizedImageRect =  // Represents the size of the resized image.
         { 0, 0, destRectRounded.width(), destRectRounded.height() };
 
-    if (srcIsFull && bitmap.hasResizedBitmap(destRectRounded.width(), destRectRounded.height())) {
+    // Apply forward transform to destRect to estimate required size of
+    // re-sampled bitmap, and use only in calls required to resize, or that
+    // check for the required size.
+    SkRect destRectTransformed;
+    canvas.getTotalMatrix().mapRect(&destRectTransformed, destRect);
+    SkIRect destRectTransformedRounded;
+    destRectTransformed.round(&destRectTransformedRounded);
+
+    if (srcIsFull && bitmap.hasResizedBitmap(destRectTransformedRounded.width(), destRectTransformedRounded.height())) {
         // Yay, this bitmap frame already has a resized version.
-        SkBitmap resampled = bitmap.resizedBitmap(destRectRounded.width(), destRectRounded.height());
+        SkBitmap resampled = bitmap.resizedBitmap(destRectTransformedRounded.width(), destRectTransformedRounded.height());
         canvas.drawBitmapRect(resampled, 0, destRect, &paint);
         return;
     }
@@ -207,8 +217,8 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
             destBitmapSubsetSkI.height())) {
         // We're supposed to resize the entire image and cache it, even though
         // we don't need all of it.
-        SkBitmap resampled = bitmap.resizedBitmap(destRectRounded.width(),
-                                                  destRectRounded.height());
+        SkBitmap resampled = bitmap.resizedBitmap(destRectTransformedRounded.width(),
+                                                  destRectTransformedRounded.height());
         canvas.drawBitmapRect(resampled, 0, destRect, &paint);
     } else {
         // We should only resize the exposed part of the bitmap to do the
@@ -217,7 +227,7 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
         // Resample the needed part of the image.
         SkBitmap resampled = skia::ImageOperations::Resize(subset,
             skia::ImageOperations::RESIZE_LANCZOS3,
-            destRectRounded.width(), destRectRounded.height(),
+            destRectTransformedRounded.width(), destRectTransformedRounded.height(),
             destBitmapSubsetSkI);
 
         // Compute where the new bitmap should be drawn. Since our new bitmap

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list