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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 void LayoutSVGShape::createPath() { | 73 void LayoutSVGShape::createPath() { |
| 74 if (!m_path) | 74 if (!m_path) |
| 75 m_path = makeUnique<Path>(); | 75 m_path = makeUnique<Path>(); |
| 76 *m_path = toSVGGeometryElement(element())->asPath(); | 76 *m_path = toSVGGeometryElement(element())->asPath(); |
| 77 if (m_rareData.get()) | 77 if (m_rareData.get()) |
| 78 m_rareData->m_cachedNonScalingStrokePath.clear(); | 78 m_rareData->m_cachedNonScalingStrokePath.clear(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 float LayoutSVGShape::dashScaleFactor() const { | 81 float LayoutSVGShape::dashScaleFactor() const { |
| 82 if (!isSVGPathElement(element()) || | 82 if (!element()->isSVGGeometryElement() || |
|
fs
2016/11/28 10:29:42
This is expected to be false always (see construct
Shanmuga Pandi
2016/11/28 12:24:14
Done.
| |
| 83 !styleRef().svgStyle().strokeDashArray()->size()) | 83 !styleRef().svgStyle().strokeDashArray()->size()) |
| 84 return 1; | 84 return 1; |
| 85 return toSVGPathElement(*element()).pathLengthScaleFactor(); | 85 return toSVGGeometryElement(*element()).pathLengthScaleFactor(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void LayoutSVGShape::updateShapeFromElement() { | 88 void LayoutSVGShape::updateShapeFromElement() { |
| 89 createPath(); | 89 createPath(); |
| 90 | 90 |
| 91 m_fillBoundingBox = calculateObjectBoundingBox(); | 91 m_fillBoundingBox = calculateObjectBoundingBox(); |
| 92 m_strokeBoundingBox = calculateStrokeBoundingBox(); | 92 m_strokeBoundingBox = calculateStrokeBoundingBox(); |
| 93 if (element()) | 93 if (element()) |
| 94 element()->setNeedsResizeObserverUpdate(); | 94 element()->setNeedsResizeObserverUpdate(); |
| 95 } | 95 } |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); | 331 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); |
| 332 } | 332 } |
| 333 | 333 |
| 334 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { | 334 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { |
| 335 if (!m_rareData) | 335 if (!m_rareData) |
| 336 m_rareData = makeUnique<LayoutSVGShapeRareData>(); | 336 m_rareData = makeUnique<LayoutSVGShapeRareData>(); |
| 337 return *m_rareData.get(); | 337 return *m_rareData.get(); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace blink | 340 } // namespace blink |
| OLD | NEW |