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

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

Issue 802833003: Remove the SVG paint culling optimization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test for the moon lander. Created 6 years 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/RenderSVGBlock.h ('k') | Source/core/rendering/svg/RenderSVGResourceFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGBlock.cpp
diff --git a/Source/core/rendering/svg/RenderSVGBlock.cpp b/Source/core/rendering/svg/RenderSVGBlock.cpp
index a3dc5c9d07b3722ad48f2003efcd85788a24a8b3..4744ea897d690f3509f48cfbddbdaaf201598d29 100644
--- a/Source/core/rendering/svg/RenderSVGBlock.cpp
+++ b/Source/core/rendering/svg/RenderSVGBlock.cpp
@@ -126,8 +126,29 @@ void RenderSVGBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintI
if (!shouldCheckForPaintInvalidation(paintInvalidationState))
return;
+ if (paintInvalidationState.cachedOffsetsEnabled()) {
+ m_cachedPaintInvalidationTransform = paintInvalidationState.svgTransform();
+ } else {
+ m_cachedPaintInvalidationTransform.makeIdentity();
+ RenderObject* next = parent();
+ while (!next->isSVGRoot()) {
+ m_cachedPaintInvalidationTransform = next->localToParentTransform() * m_cachedPaintInvalidationTransform;
+ next = next->parent();
+ ASSERT(next);
+ }
+ m_cachedPaintInvalidationTransform = toRenderSVGRoot(next)->localToBorderBoxTransform() * m_cachedPaintInvalidationTransform;
+ }
+
ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState);
RenderBlockFlow::invalidateTreeIfNeeded(paintInvalidationState);
}
+void RenderSVGBlock::updatePaintInfoRect(IntRect& rect)
+{
+ if (rect != LayoutRect::infiniteRect()) {
+ AffineTransform transformToRoot = m_cachedPaintInvalidationTransform * localTransform();
+ rect = enclosingIntRect(transformToRoot.inverse().mapRect(FloatRect(rect)));
+ }
+}
+
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGBlock.h ('k') | Source/core/rendering/svg/RenderSVGResourceFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698