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

Unified Diff: third_party/WebKit/Source/core/style/StylePath.cpp

Issue 1640313002: Lazily create the Path in StylePath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePath.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/StylePath.cpp
diff --git a/third_party/WebKit/Source/core/style/StylePath.cpp b/third_party/WebKit/Source/core/style/StylePath.cpp
index 674ba453142edff904bd52a58cce32e3da49fbbf..5ed7a3c2a619ee38b5b2346ed75b39ae2c25940d 100644
--- a/third_party/WebKit/Source/core/style/StylePath.cpp
+++ b/third_party/WebKit/Source/core/style/StylePath.cpp
@@ -7,6 +7,7 @@
#include "core/css/CSSPathValue.h"
#include "core/svg/SVGPathByteStream.h"
#include "core/svg/SVGPathUtilities.h"
+#include "platform/graphics/Path.h"
namespace blink {
@@ -14,7 +15,6 @@ StylePath::StylePath(PassRefPtr<SVGPathByteStream> pathByteStream)
: m_byteStream(pathByteStream)
{
ASSERT(m_byteStream);
- buildPathFromByteStream(*m_byteStream, m_path);
}
StylePath::~StylePath()
@@ -32,6 +32,15 @@ StylePath* StylePath::emptyPath()
return emptyPath;
}
+const Path& StylePath::path() const
+{
+ if (!m_path) {
+ m_path = adoptPtr(new Path);
+ buildPathFromByteStream(*m_byteStream, *m_path);
+ }
+ return *m_path;
+}
+
const SVGPathByteStream& StylePath::byteStream() const
{
return *m_byteStream;
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698