Title: [116185] trunk/Source/WebCore
Revision
116185
Author
[email protected]
Date
2012-05-04 15:55:01 -0700 (Fri, 04 May 2012)

Log Message

Correct pixel snapping in RenderSVGRoot::paintReplaced
https://bugs.webkit.org/show_bug.cgi?id=85671

Reviewed by Eric Seidel.

SVG root elements are still painted on pixel boundaries, so their children should
apply transforms based on their actual painted location, not their sub-pixel
one. This corrects a clipping and painting issue where these sub-pixel units are
incorrectly applied to the graphics context.

Covered by existing tests when sub-pixel layout is enabled.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116184 => 116185)


--- trunk/Source/WebCore/ChangeLog	2012-05-04 22:54:25 UTC (rev 116184)
+++ trunk/Source/WebCore/ChangeLog	2012-05-04 22:55:01 UTC (rev 116185)
@@ -1,3 +1,20 @@
+2012-05-04  Levi Weintraub  <[email protected]>
+
+        Correct pixel snapping in RenderSVGRoot::paintReplaced
+        https://bugs.webkit.org/show_bug.cgi?id=85671
+
+        Reviewed by Eric Seidel.
+
+        SVG root elements are still painted on pixel boundaries, so their children should
+        apply transforms based on their actual painted location, not their sub-pixel
+        one. This corrects a clipping and painting issue where these sub-pixel units are
+        incorrectly applied to the graphics context.
+
+        Covered by existing tests when sub-pixel layout is enabled.
+
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::paintReplaced):
+
 2012-05-04  Adam Barth  <[email protected]>
 
         Refactor CSP state to prepare for having both a ReportOnly and an Enforced policy

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (116184 => 116185)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2012-05-04 22:54:25 UTC (rev 116184)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2012-05-04 22:55:01 UTC (rev 116185)
@@ -253,7 +253,7 @@
     setNeedsLayout(false);
 }
 
-void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& adjustedPaintOffset)
+void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
     // An empty viewport disables rendering.
     if (pixelSnappedBorderBoxRect().isEmpty())
@@ -285,10 +285,11 @@
     childPaintInfo.context->save();
 
     // Apply initial viewport clip - not affected by overflow handling
-    childPaintInfo.context->clip(overflowClipRect(adjustedPaintOffset, paintInfo.renderRegion));
+    childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset, paintInfo.renderRegion)));
 
     // 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());
 
     SVGRenderingContext renderingContext;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to