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

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: Rebase. 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
Index: Source/core/rendering/svg/SVGRenderSupport.cpp
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp
index 6f7103f84309de0f7c6e8de99b2215518e8f3806..38ce60e8690ccc10af99ec57967652a19b5a75c2 100644
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp
@@ -62,6 +62,22 @@ void SVGRenderSupport::computeFloatRectForPaintInvalidation(const RenderObject*
{
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());
+ paintInvalidationRect = rect;
+ return;
+ }
+
// Translate to coords in our parent renderer, and then call computeFloatRectForPaintInvalidation() on our parent.
paintInvalidationRect = object->localToParentTransform().mapRect(paintInvalidationRect);
object->parent()->computeFloatRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState);
@@ -71,6 +87,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

Powered by Google App Engine
This is Rietveld 408576698