| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSPathValue_h | 5 #ifndef CSSPathValue_h |
| 6 #define CSSPathValue_h | 6 #define CSSPathValue_h |
| 7 | 7 |
| 8 #include "core/css/CSSValue.h" | 8 #include "core/css/CSSValue.h" |
| 9 #include "core/svg/SVGPathByteStream.h" |
| 10 #include "platform/graphics/Path.h" |
| 9 #include "wtf/PassRefPtr.h" | 11 #include "wtf/PassRefPtr.h" |
| 10 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
| 11 | 13 |
| 12 namespace blink { | 14 namespace blink { |
| 13 | 15 |
| 14 class CSSPathValue : public CSSValue { | 16 class CSSPathValue : public CSSValue { |
| 15 public: | 17 public: |
| 16 static PassRefPtrWillBeRawPtr<CSSPathValue> create(const String& pathString) | 18 static PassRefPtrWillBeRawPtr<CSSPathValue> create(PassOwnPtr<SVGPathByteStr
eam> pathByteStream) |
| 17 { | 19 { |
| 18 return adoptRefWillBeNoop(new CSSPathValue(pathString)); | 20 return adoptRefWillBeNoop(new CSSPathValue(pathByteStream)); |
| 19 } | 21 } |
| 20 | 22 |
| 23 static PassRefPtrWillBeRawPtr<CSSPathValue> create(const String&); |
| 24 |
| 25 static CSSPathValue* emptyPathValue(); |
| 26 |
| 21 String customCSSText() const; | 27 String customCSSText() const; |
| 22 | 28 |
| 23 bool equals(const CSSPathValue&) const; | 29 bool equals(const CSSPathValue&) const; |
| 24 | 30 |
| 25 DECLARE_TRACE_AFTER_DISPATCH(); | 31 DECLARE_TRACE_AFTER_DISPATCH(); |
| 26 | 32 |
| 27 const String& pathString() const { return m_pathString; } | 33 const SVGPathByteStream& byteStream() const { return *m_pathByteStream; } |
| 34 String pathString() const; |
| 35 const Path& path() const { return m_path; } |
| 28 | 36 |
| 29 private: | 37 private: |
| 30 CSSPathValue(const String& pathString); | 38 CSSPathValue(PassOwnPtr<SVGPathByteStream>); |
| 31 | 39 |
| 32 String m_pathString; | 40 OwnPtr<SVGPathByteStream> m_pathByteStream; |
| 41 Path m_path; |
| 33 }; | 42 }; |
| 34 | 43 |
| 35 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPathValue, isPathValue()); | 44 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPathValue, isPathValue()); |
| 36 | 45 |
| 37 } // namespace blink | 46 } // namespace blink |
| 38 | 47 |
| 39 #endif // CSSPathValue_h | 48 #endif // CSSPathValue_h |
| OLD | NEW |