Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| index 9982e8a03fa82f724ad7bf3b25c33e0bfe9c0ef2..838b9b293994ebd7a20c7f474ad2c0f9ccde1439 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp |
| @@ -71,7 +71,10 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking( |
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| // In SPv2, visual rects are in the space of their local transform node. |
| - rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| + // For SVG, the input rect is in local SVG coordinates in which paint |
| + // offset doesn't apply. |
| + if (object.isSVG() && !object.isSVGRoot()) |
| + rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| // Use enclosingIntRect to ensure the final visual rect will cover the |
| // rect in source coordinates no matter if the painting will use pixel |
| // snapping. |
| @@ -86,8 +89,10 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking( |
| } else if (object == context.paintInvalidationContainer) { |
| result = LayoutRect(rect); |
| } else { |
| - rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| - if ((!object.isSVG() || object.isSVGRoot()) && !rect.isEmpty()) { |
|
Xianzhu
2016/12/06 18:35:26
!rect.isEmpty() is removed to be consistent with t
|
| + // For non-root SVG, the input rect is in local SVG coordinates in which |
| + // paint offset doesn't apply. |
| + if (!object.isSVG() || object.isSVGRoot()) { |
| + rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset)); |
| // Use enclosingIntRect to ensure the final visual rect will cover the |
| // rect in source coordinates no matter if the painting will use pixel |
| // snapping. |