Title: [132377] trunk
Revision
132377
Author
fmal...@chromium.org
Date
2012-10-24 11:13:57 -0700 (Wed, 24 Oct 2012)

Log Message

[Chromium] SVG repaint issues
https://bugs.webkit.org/show_bug.cgi?id=99874

Reviewed by Levi Weintraub.

Source/WebCore:

RenderSVGRoot::paintReplaced() converts the container offsets to a relative transform,
but in doing so it ends up accumulating subpixel rounding deltas twice: first for
adjustedPaintOffset and second in localToParentTransform(). If coordinates are on
half-pixel boundaries, the 2x rounding delta yields a full pixel drift and we end up
painting at the wrong location.

This can be avoided by using localToBorderBoxTransform() directly, which (unlike
localToParentTransform()) doesn't perform rounding.

No new tests: existing pixel results cover this change after rebaseline.

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):

LayoutTests:

* platform/chromium-linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png:
* platform/chromium-linux/svg/zoom/text/zoom-svg-float-border-padding-expected.png:
* platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.png:
* platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.png:
* platform/chromium/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (132376 => 132377)


--- trunk/LayoutTests/ChangeLog	2012-10-24 18:10:28 UTC (rev 132376)
+++ trunk/LayoutTests/ChangeLog	2012-10-24 18:13:57 UTC (rev 132377)
@@ -1,3 +1,16 @@
+2012-10-24  Florin Malita  <fmal...@chromium.org>
+
+        [Chromium] SVG repaint issues
+        https://bugs.webkit.org/show_bug.cgi?id=99874
+
+        Reviewed by Levi Weintraub.
+
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png:
+        * platform/chromium-linux/svg/zoom/text/zoom-svg-float-border-padding-expected.png:
+        * platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.png:
+        * platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.png:
+        * platform/chromium/TestExpectations:
+
 2012-10-24  Dana Jansens  <dan...@chromium.org>
 
         Layout tests to verify scaled composited layers have crisp text

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (132376 => 132377)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-10-24 18:10:28 UTC (rev 132376)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-10-24 18:13:57 UTC (rev 132377)
@@ -2794,6 +2794,12 @@
 crbug.com/83504 [ Win ] fast/css/custom-font-xheight.html [ Failure Pass Slow ]
 crbug.com/83504 [ Mac ] fast/css/custom-font-xheight.html [ Failure Pass ]
 
+# Need rebaselining after 99874
+webkit.org/b/99874 svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute.xhtml [ Pass ImageOnlyFailure ]
+webkit.org/b/99874 svg/custom/object-sizing-width-50p-height-75p-on-target-svg.xhtml [ Pass ImageOnlyFailure ]
+webkit.org/b/99874 svg/zoom/page/zoom-svg-float-border-padding.xml [ Pass ImageOnlyFailure ]
+webkit.org/b/99874 svg/zoom/text/zoom-svg-float-border-padding.xml [ Pass ImageOnlyFailure ]
+
 # New tests added in r87121
 webkit.org/b/61169 [ Android Linux Win ] css3/images/optimize-contrast-canvas.html [ ImageOnlyFailure ]
 webkit.org/b/61169 [ Android Linux Win ] css3/images/optimize-contrast-image.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/text/zoom-svg-float-border-padding-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-win/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.png


(Binary files differ)

Modified: trunk/Source/WebCore/ChangeLog (132376 => 132377)


--- trunk/Source/WebCore/ChangeLog	2012-10-24 18:10:28 UTC (rev 132376)
+++ trunk/Source/WebCore/ChangeLog	2012-10-24 18:13:57 UTC (rev 132377)
@@ -1,3 +1,24 @@
+2012-10-24  Florin Malita  <fmal...@chromium.org>
+
+        [Chromium] SVG repaint issues
+        https://bugs.webkit.org/show_bug.cgi?id=99874
+
+        Reviewed by Levi Weintraub.
+
+        RenderSVGRoot::paintReplaced() converts the container offsets to a relative transform,
+        but in doing so it ends up accumulating subpixel rounding deltas twice: first for 
+        adjustedPaintOffset and second in localToParentTransform(). If coordinates are on
+        half-pixel boundaries, the 2x rounding delta yields a full pixel drift and we end up
+        painting at the wrong location.
+
+        This can be avoided by using localToBorderBoxTransform() directly, which (unlike
+        localToParentTransform()) doesn't perform rounding.
+
+        No new tests: existing pixel results cover this change after rebaseline.
+
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::paintReplaced):
+
 2012-10-24  Levi Weintraub  <le...@chromium.org>
 
         Fixing the Chromium build after typo in r132367.

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (132376 => 132377)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2012-10-24 18:10:28 UTC (rev 132376)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2012-10-24 18:13:57 UTC (rev 132377)
@@ -297,7 +297,7 @@
     // Convert from container offsets (html renderers) to a relative transform (svg renderers).
     // Transform from our paint container's coordinate system to our local coords.
     IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset);
-    childPaintInfo.applyTransform(AffineTransform::translation(adjustedPaintOffset.x() - x(), adjustedPaintOffset.y() - y()) * localToParentTransform());
+    childPaintInfo.applyTransform(AffineTransform::translation(adjustedPaintOffset.x(), adjustedPaintOffset.y()) * localToBorderBoxTransform());
 
     SVGRenderingContext renderingContext;
     bool continueRendering = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to