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

Unified Diff: third_party/WebKit/Source/core/css/CSSPathValue.cpp

Issue 1545713003: Add StylePath and use it to store 'd' in ComputedStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015->2016; Remove unnecessary explicit. 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/css/CSSPathValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.cpp b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
index d4557518c6e35bbec2d559aa6e265e5ab3471a57..f725d430de82061109b0da6000ed1000a95e6bfe 100644
--- a/third_party/WebKit/Source/core/css/CSSPathValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
@@ -4,23 +4,33 @@
#include "core/css/CSSPathValue.h"
+#include "core/style/StylePath.h"
#include "core/svg/SVGPathUtilities.h"
namespace blink {
+PassRefPtrWillBeRawPtr<CSSPathValue> CSSPathValue::create(PassRefPtr<SVGPathByteStream> pathByteStream, StylePath* cachedPath)
+{
+ return adoptRefWillBeNoop(new CSSPathValue(pathByteStream, cachedPath));
+}
+
PassRefPtrWillBeRawPtr<CSSPathValue> CSSPathValue::create(const String& pathString)
{
- OwnPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create();
+ RefPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create();
buildByteStreamFromString(pathString, *byteStream);
return CSSPathValue::create(byteStream.release());
}
-CSSPathValue::CSSPathValue(PassOwnPtr<SVGPathByteStream> pathByteStream)
+CSSPathValue::CSSPathValue(PassRefPtr<SVGPathByteStream> pathByteStream, StylePath* cachedPath)
: CSSValue(PathClass)
, m_pathByteStream(pathByteStream)
+ , m_cachedPath(cachedPath)
{
ASSERT(m_pathByteStream);
- buildPathFromByteStream(*m_pathByteStream, m_path);
+}
+
+CSSPathValue::~CSSPathValue()
+{
}
CSSPathValue* CSSPathValue::emptyPathValue()
@@ -29,6 +39,13 @@ CSSPathValue* CSSPathValue::emptyPathValue()
return empty.get();
}
+StylePath* CSSPathValue::cachedPath()
+{
+ if (!m_cachedPath)
+ m_cachedPath = StylePath::create(m_pathByteStream);
+ return m_cachedPath.get();
+}
+
String CSSPathValue::customCSSText() const
{
return "path('" + pathString() + "')";
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPathValue.h ('k') | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698