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

Unified Diff: third_party/WebKit/Source/core/svg/SVGPathElement.cpp

Issue 1425913004: [SVG] Shared <use> path geometry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
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()

Powered by Google App Engine
This is Rietveld 408576698