| 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 "platform/graphics/Path.h" | |
| 9 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 #include "wtf/OwnPtr.h" |
| 10 #include "wtf/PassRefPtr.h" | 10 #include "wtf/PassRefPtr.h" |
| 11 #include "wtf/RefCounted.h" | 11 #include "wtf/RefCounted.h" |
| 12 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class CSSValue; | 16 class CSSValue; |
| 17 class Path; |
| 17 class SVGPathByteStream; | 18 class SVGPathByteStream; |
| 18 | 19 |
| 19 class StylePath : public RefCounted<StylePath> { | 20 class StylePath : public RefCounted<StylePath> { |
| 20 public: | 21 public: |
| 21 static PassRefPtr<StylePath> create(PassRefPtr<SVGPathByteStream>); | 22 static PassRefPtr<StylePath> create(PassRefPtr<SVGPathByteStream>); |
| 22 ~StylePath(); | 23 ~StylePath(); |
| 23 | 24 |
| 24 static StylePath* emptyPath(); | 25 static StylePath* emptyPath(); |
| 25 | 26 |
| 26 const Path& path() const { return m_path; } | 27 const Path& path() const; |
| 27 const SVGPathByteStream& byteStream() const; | 28 const SVGPathByteStream& byteStream() const; |
| 28 | 29 |
| 29 PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const; | 30 PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const; |
| 30 | 31 |
| 31 bool equals(const StylePath&) const; | 32 bool equals(const StylePath&) const; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 explicit StylePath(PassRefPtr<SVGPathByteStream>); | 35 explicit StylePath(PassRefPtr<SVGPathByteStream>); |
| 35 | 36 |
| 36 RefPtr<SVGPathByteStream> m_byteStream; | 37 RefPtr<SVGPathByteStream> m_byteStream; |
| 37 Path m_path; | 38 mutable OwnPtr<Path> m_path; |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 } // namespace blink | 41 } // namespace blink |
| 41 | 42 |
| 42 #endif // StylePath_h | 43 #endif // StylePath_h |
| OLD | NEW |