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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } else { 145 } else {
146 m_localTransform = 0; 146 m_localTransform = 0;
147 } 147 }
148 } 148 }
149 149
150 void LayoutSVGShape::layout() 150 void LayoutSVGShape::layout()
151 { 151 {
152 bool updateCachedBoundariesInParents = false; 152 bool updateCachedBoundariesInParents = false;
153 LayoutAnalyzer::Scope analyzer(*this); 153 LayoutAnalyzer::Scope analyzer(*this);
154 154
155 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { 155 if (m_needsBoundariesUpdate && toSVGGeometryElement(element())->selfHasRelat iveLengths())
156 m_needsShapeUpdate = true;
157
158 if (m_needsShapeUpdate)
156 updateShapeFromElement(); 159 updateShapeFromElement();
fs 2015/06/01 09:09:19 This also updates m_strokeBoundingBox, so we'll ne
157 m_needsShapeUpdate = false; 160
161 if (m_needsBoundariesUpdate || m_needsShapeUpdate) {
158 updatePaintInvalidationBoundingBox(); 162 updatePaintInvalidationBoundingBox();
159 m_needsBoundariesUpdate = false; 163 m_needsBoundariesUpdate = false;
164 m_needsShapeUpdate = false;
160 updateCachedBoundariesInParents = true; 165 updateCachedBoundariesInParents = true;
161 } 166 }
162 167
163 if (m_needsTransformUpdate) { 168 if (m_needsTransformUpdate) {
164 updateLocalTransform(); 169 updateLocalTransform();
165 m_needsTransformUpdate = false; 170 m_needsTransformUpdate = false;
166 updateCachedBoundariesInParents = true; 171 updateCachedBoundariesInParents = true;
167 } 172 }
168 173
169 // Invalidate all resources of this client if our layout changed. 174 // Invalidate all resources of this client if our layout changed.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox); 283 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox);
279 } 284 }
280 285
281 float LayoutSVGShape::strokeWidth() const 286 float LayoutSVGShape::strokeWidth() const
282 { 287 {
283 SVGLengthContext lengthContext(element()); 288 SVGLengthContext lengthContext(element());
284 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); 289 return lengthContext.valueForLength(style()->svgStyle().strokeWidth());
285 } 290 }
286 291
287 } 292 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698