Changeset 116185 in webkit


Ignore:
Timestamp:
May 4, 2012 3:55:01 PM (12 years ago)
Author:
leviw@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116177 r116185  
     12012-05-04  Levi Weintraub  <leviw@chromium.org>
     2
     3        Correct pixel snapping in RenderSVGRoot::paintReplaced
     4        https://bugs.webkit.org/show_bug.cgi?id=85671
     5
     6        Reviewed by Eric Seidel.
     7
     8        SVG root elements are still painted on pixel boundaries, so their children should
     9        apply transforms based on their actual painted location, not their sub-pixel
     10        one. This corrects a clipping and painting issue where these sub-pixel units are
     11        incorrectly applied to the graphics context.
     12
     13        Covered by existing tests when sub-pixel layout is enabled.
     14
     15        * rendering/svg/RenderSVGRoot.cpp:
     16        (WebCore::RenderSVGRoot::paintReplaced):
     17
    1182012-05-04  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r115981 r116185  
    254254}
    255255
    256 void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& adjustedPaintOffset)
     256void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    257257{
    258258    // An empty viewport disables rendering.
     
    286286
    287287    // Apply initial viewport clip - not affected by overflow handling
    288     childPaintInfo.context->clip(overflowClipRect(adjustedPaintOffset, paintInfo.renderRegion));
     288    childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffset, paintInfo.renderRegion)));
    289289
    290290    // Convert from container offsets (html renderers) to a relative transform (svg renderers).
    291291    // Transform from our paint container's coordinate system to our local coords.
     292    IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset);
    292293    childPaintInfo.applyTransform(AffineTransform::translation(adjustedPaintOffset.x() - x(), adjustedPaintOffset.y() - y()) * localToParentTransform());
    293294
Note: See TracChangeset for help on using the changeset viewer.