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

Unified Diff: Source/core/layout/svg/LayoutSVGShape.cpp

Issue 1158583003: Reduce how often LayoutSVGShape::updateShapeFromElement is called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/layout/svg/LayoutSVGShape.cpp
diff --git a/Source/core/layout/svg/LayoutSVGShape.cpp b/Source/core/layout/svg/LayoutSVGShape.cpp
index f5f47a848267768566bd24f9858ad452e8490d10..61ff20e5a9cb76e739e55f331eb1218a8bf17497 100644
--- a/Source/core/layout/svg/LayoutSVGShape.cpp
+++ b/Source/core/layout/svg/LayoutSVGShape.cpp
@@ -152,11 +152,16 @@ void LayoutSVGShape::layout()
bool updateCachedBoundariesInParents = false;
LayoutAnalyzer::Scope analyzer(*this);
- if (m_needsShapeUpdate || m_needsBoundariesUpdate) {
+ if (m_needsBoundariesUpdate && toSVGGeometryElement(element())->selfHasRelativeLengths())
+ m_needsShapeUpdate = true;
+
+ if (m_needsShapeUpdate)
updateShapeFromElement();
fs 2015/06/01 09:09:19 This also updates m_strokeBoundingBox, so we'll ne
- m_needsShapeUpdate = false;
+
+ if (m_needsBoundariesUpdate || m_needsShapeUpdate) {
updatePaintInvalidationBoundingBox();
m_needsBoundariesUpdate = false;
+ m_needsShapeUpdate = false;
updateCachedBoundariesInParents = true;
}

Powered by Google App Engine
This is Rietveld 408576698