Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: Source/core/rendering/svg/SVGRenderSupport.cpp

Issue 598623002: Initial PaintInvalidationState support for SVG (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move code to clippedOverflow... Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGRenderSupport.cpp
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp
index f0a9cee861f40d10acd9c1ed29debfaf0265d3b3..397b16c5542c88546e3edd278f3308131f557b5e 100644
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp
@@ -56,6 +56,21 @@ LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende
FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordinates();
paintInvalidationRect.inflate(object->style()->outlineWidth());
+ if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
+ // Compute accumulated SVG transform and apply to local paint rect.
+ AffineTransform transform = paintInvalidationState->svgTransform() * object->localToParentTransform();
+ paintInvalidationRect = transform.mapRect(paintInvalidationRect);
+ // FIXME: These are quirks carried forward from RenderSVGRoot::computeFloatRectForPaintInvalidation.
+ LayoutRect rect;
+ if (!paintInvalidationRect.isEmpty())
+ rect = enclosingIntRect(paintInvalidationRect);
+ // Offset by SVG root paint offset and apply clipping as needed.
+ rect.move(paintInvalidationState->paintOffset());
+ if (paintInvalidationState->isClipped())
+ rect.intersect(paintInvalidationState->clipRect());
+ return rect;
+ }
+
object->computeFloatRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState);
return enclosingLayoutRect(paintInvalidationRect);
}
@@ -71,6 +86,13 @@ void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren
{
transformState.applyTransform(object->localToParentTransform());
+ if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
+ // |svgTransform| contains localToBorderBoxTransform mentioned below.
+ transformState.applyTransform(paintInvalidationState->svgTransform());
+ transformState.move(paintInvalidationState->paintOffset());
+ return;
+ }
+
RenderObject* parent = object->parent();
// At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderBoxTransform
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698