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() + "')"; |