OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 { | 65 { |
66 visitor->trace(m_pathLength); | 66 visitor->trace(m_pathLength); |
67 visitor->trace(m_path); | 67 visitor->trace(m_path); |
68 SVGGeometryElement::trace(visitor); | 68 SVGGeometryElement::trace(visitor); |
69 } | 69 } |
70 | 70 |
71 DEFINE_NODE_FACTORY(SVGPathElement) | 71 DEFINE_NODE_FACTORY(SVGPathElement) |
72 | 72 |
73 Path SVGPathElement::asPath() const | 73 Path SVGPathElement::asPath() const |
74 { | 74 { |
75 Path path; | 75 // If this is a <use> instance, return the referenced path to maximize geome
try sharing. |
76 buildPathFromByteStream(pathByteStream(), path); | 76 if (const SVGElement* element = correspondingElement()) |
77 return path; | 77 return toSVGPathElement(element)->asPath(); |
| 78 |
| 79 return m_path->currentValue()->path(); |
78 } | 80 } |
79 | 81 |
80 float SVGPathElement::getTotalLength() | 82 float SVGPathElement::getTotalLength() |
81 { | 83 { |
82 return getTotalLengthOfSVGPathByteStream(pathByteStream()); | 84 return getTotalLengthOfSVGPathByteStream(pathByteStream()); |
83 } | 85 } |
84 | 86 |
85 PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float l
ength) | 87 PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float l
ength) |
86 { | 88 { |
87 FloatPoint point = getPointAtLengthOfSVGPathByteStream(pathByteStream(), len
gth); | 89 FloatPoint point = getPointAtLengthOfSVGPathByteStream(pathByteStream(), len
gth); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return InsertionDone; | 137 return InsertionDone; |
136 } | 138 } |
137 | 139 |
138 void SVGPathElement::removedFrom(ContainerNode* rootParent) | 140 void SVGPathElement::removedFrom(ContainerNode* rootParent) |
139 { | 141 { |
140 SVGGeometryElement::removedFrom(rootParent); | 142 SVGGeometryElement::removedFrom(rootParent); |
141 invalidateMPathDependencies(); | 143 invalidateMPathDependencies(); |
142 } | 144 } |
143 | 145 |
144 } // namespace blink | 146 } // namespace blink |
OLD | NEW |