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 PathStyleMotionPath_h | 5 #ifndef PathStyleMotionPath_h |
6 #define PathStyleMotionPath_h | 6 #define PathStyleMotionPath_h |
7 | 7 |
8 #include "core/style/StyleMotionPath.h" | 8 #include "core/style/StyleMotionPath.h" |
9 | 9 |
10 #include "platform/graphics/Path.h" | 10 #include "platform/graphics/Path.h" |
11 #include "wtf/Assertions.h" | 11 #include "wtf/Assertions.h" |
12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class PathStyleMotionPath : public StyleMotionPath { | 16 class PathStyleMotionPath : public StyleMotionPath { |
17 public: | 17 public: |
18 static PassRefPtr<PathStyleMotionPath> create(const String& pathString) | 18 static PassRefPtr<PathStyleMotionPath> create(const String& pathString) |
19 { | 19 { |
20 return adoptRef(new PathStyleMotionPath(pathString)); | 20 return adoptRef(new PathStyleMotionPath(pathString)); |
21 } | 21 } |
22 | 22 |
23 virtual bool isPathStyleMotionPath() const override { return true; } | 23 bool isPathStyleMotionPath() const override { return true; } |
24 | 24 |
25 bool equals(const PathStyleMotionPath& other) const | 25 bool equals(const PathStyleMotionPath& other) const |
26 { | 26 { |
27 return m_pathString == other.m_pathString; | 27 return m_pathString == other.m_pathString; |
28 } | 28 } |
29 | 29 |
30 const Path& path() const { return m_path; } | 30 const Path& path() const { return m_path; } |
31 | 31 |
32 const String& pathString() const { return m_pathString; } | 32 const String& pathString() const { return m_pathString; } |
33 | 33 |
34 bool isClosed() const; | 34 bool isClosed() const; |
35 | 35 |
36 float length() const { return m_length; } | 36 float length() const { return m_length; } |
37 | 37 |
38 private: | 38 private: |
39 PathStyleMotionPath(const String& pathString); | 39 PathStyleMotionPath(const String& pathString); |
40 | 40 |
41 String m_pathString; | 41 String m_pathString; |
42 Path m_path; | 42 Path m_path; |
43 float m_length; | 43 float m_length; |
44 }; | 44 }; |
45 | 45 |
46 DEFINE_TYPE_CASTS(PathStyleMotionPath, StyleMotionPath, value, value->isPathStyl
eMotionPath(), value.isPathStyleMotionPath()); | 46 DEFINE_TYPE_CASTS(PathStyleMotionPath, StyleMotionPath, value, value->isPathStyl
eMotionPath(), value.isPathStyleMotionPath()); |
47 | 47 |
48 } // namespace blink | 48 } // namespace blink |
49 | 49 |
50 #endif // PathStyleMotionPath_h | 50 #endif // PathStyleMotionPath_h |
OLD | NEW |