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

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

Issue 1649003002: Use StylePath instead of (Path)StyleMotionPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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
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 5ed7a3c2a619ee38b5b2346ed75b39ae2c25940d..2f67b68bfec1cf01227ecfa85db9c5371156bdab 100644
--- a/third_party/WebKit/Source/core/style/StylePath.cpp
+++ b/third_party/WebKit/Source/core/style/StylePath.cpp
@@ -13,6 +13,7 @@ namespace blink {
StylePath::StylePath(PassRefPtr<SVGPathByteStream> pathByteStream)
: m_byteStream(pathByteStream)
+ , m_pathLength(std::numeric_limits<float>::quiet_NaN())
{
ASSERT(m_byteStream);
}
@@ -41,6 +42,18 @@ const Path& StylePath::path() const
return *m_path;
}
+float StylePath::length() const
+{
+ if (std::isnan(m_pathLength))
+ m_pathLength = path().length();
+ return m_pathLength;
+}
+
+bool StylePath::isClosed() const
+{
+ return path().isClosed();
+}
+
const SVGPathByteStream& StylePath::byteStream() const
{
return *m_byteStream;
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePath.h ('k') | third_party/WebKit/Source/platform/graphics/Path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698