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

Unified Diff: third_party/WebKit/Source/core/style/StylePath.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
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePath.h ('k') | third_party/WebKit/Source/core/svg/SVGPath.cpp » ('j') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..674ba453142edff904bd52a58cce32e3da49fbbf
--- /dev/null
+++ b/third_party/WebKit/Source/core/style/StylePath.cpp
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/style/StylePath.h"
+
+#include "core/css/CSSPathValue.h"
+#include "core/svg/SVGPathByteStream.h"
+#include "core/svg/SVGPathUtilities.h"
+
+namespace blink {
+
+StylePath::StylePath(PassRefPtr<SVGPathByteStream> pathByteStream)
+ : m_byteStream(pathByteStream)
+{
+ ASSERT(m_byteStream);
+ buildPathFromByteStream(*m_byteStream, m_path);
+}
+
+StylePath::~StylePath()
+{
+}
+
+PassRefPtr<StylePath> StylePath::create(PassRefPtr<SVGPathByteStream> pathByteStream)
+{
+ return adoptRef(new StylePath(pathByteStream));
+}
+
+StylePath* StylePath::emptyPath()
+{
+ DEFINE_STATIC_REF(StylePath, emptyPath, StylePath::create(SVGPathByteStream::create()));
+ return emptyPath;
+}
+
+const SVGPathByteStream& StylePath::byteStream() const
+{
+ return *m_byteStream;
+}
+
+PassRefPtrWillBeRawPtr<CSSValue> StylePath::computedCSSValue() const
+{
+ return CSSPathValue::create(m_byteStream, const_cast<StylePath*>(this));
+}
+
+bool StylePath::equals(const StylePath& other) const
+{
+ return *m_byteStream == *other.m_byteStream;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePath.h ('k') | third_party/WebKit/Source/core/svg/SVGPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698