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