Index: third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGPathElement.cpp b/third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
index 8a26824bbabad397c0903c1a668485173d08e32e..94b22165159e02ad9d8de000a9ad1fec3e481ea4 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGPathElement.cpp |
@@ -72,9 +72,11 @@ DEFINE_NODE_FACTORY(SVGPathElement) |
Path SVGPathElement::asPath() const |
{ |
- Path path; |
- buildPathFromByteStream(pathByteStream(), path); |
- return path; |
+ // If this is a <use> instance, return the referenced path to maximize geometry sharing. |
+ if (const SVGElement* element = correspondingElement()) |
+ return toSVGPathElement(element)->asPath(); |
+ |
+ return m_path->currentValue()->path(); |
} |
float SVGPathElement::getTotalLength() |