Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |