| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 StylePath_h | 5 #ifndef StylePath_h |
| 6 #define StylePath_h | 6 #define StylePath_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" |
| 8 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 9 #include "wtf/PassRefPtr.h" | 10 #include "wtf/PassRefPtr.h" |
| 10 #include "wtf/RefCounted.h" | 11 #include "wtf/RefCounted.h" |
| 11 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
| 12 #include <memory> | 13 #include <memory> |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 class CSSValue; | 17 class CSSValue; |
| 17 class Path; | 18 class Path; |
| 18 class SVGPathByteStream; | 19 class SVGPathByteStream; |
| 19 | 20 |
| 20 class StylePath : public RefCounted<StylePath> { | 21 class CORE_EXPORT StylePath : public RefCounted<StylePath> { |
| 21 public: | 22 public: |
| 22 static PassRefPtr<StylePath> create(std::unique_ptr<SVGPathByteStream>); | 23 static PassRefPtr<StylePath> create(std::unique_ptr<SVGPathByteStream>); |
| 23 ~StylePath(); | 24 ~StylePath(); |
| 24 | 25 |
| 25 static StylePath* emptyPath(); | 26 static StylePath* emptyPath(); |
| 26 | 27 |
| 27 const Path& path() const; | 28 const Path& path() const; |
| 28 float length() const; | 29 float length() const; |
| 29 bool isClosed() const; | 30 bool isClosed() const; |
| 30 | 31 |
| 31 const SVGPathByteStream& byteStream() const { return *m_byteStream; } | 32 const SVGPathByteStream& byteStream() const { return *m_byteStream; } |
| 32 | 33 |
| 33 CSSValue* computedCSSValue() const; | 34 CSSValue* computedCSSValue() const; |
| 34 | 35 |
| 35 bool operator==(const StylePath&) const; | 36 bool operator==(const StylePath&) const; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 explicit StylePath(std::unique_ptr<SVGPathByteStream>); | 39 explicit StylePath(std::unique_ptr<SVGPathByteStream>); |
| 39 | 40 |
| 40 std::unique_ptr<SVGPathByteStream> m_byteStream; | 41 std::unique_ptr<SVGPathByteStream> m_byteStream; |
| 41 mutable std::unique_ptr<Path> m_path; | 42 mutable std::unique_ptr<Path> m_path; |
| 42 mutable float m_pathLength; | 43 mutable float m_pathLength; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace blink | 46 } // namespace blink |
| 46 | 47 |
| 47 #endif // StylePath_h | 48 #endif // StylePath_h |
| OLD | NEW |