OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_ANIMATION_TIMING_FUNCTION_H_ | 5 #ifndef CC_ANIMATION_TIMING_FUNCTION_H_ |
6 #define CC_ANIMATION_TIMING_FUNCTION_H_ | 6 #define CC_ANIMATION_TIMING_FUNCTION_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 double x2, | 41 double x2, |
42 double y2); | 42 double y2); |
43 ~CubicBezierTimingFunction() override; | 43 ~CubicBezierTimingFunction() override; |
44 | 44 |
45 // TimingFunction implementation. | 45 // TimingFunction implementation. |
46 float GetValue(double time) const override; | 46 float GetValue(double time) const override; |
47 float Velocity(double time) const override; | 47 float Velocity(double time) const override; |
48 void Range(float* min, float* max) const override; | 48 void Range(float* min, float* max) const override; |
49 std::unique_ptr<TimingFunction> Clone() const override; | 49 std::unique_ptr<TimingFunction> Clone() const override; |
50 | 50 |
| 51 EaseType ease_type() const { return ease_type_; } |
| 52 |
51 protected: | 53 protected: |
52 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 54 CubicBezierTimingFunction(EaseType ease_type, |
| 55 double x1, |
| 56 double y1, |
| 57 double x2, |
| 58 double y2); |
53 | 59 |
54 gfx::CubicBezier bezier_; | 60 gfx::CubicBezier bezier_; |
| 61 EaseType ease_type_; |
55 | 62 |
56 private: | 63 private: |
57 DISALLOW_ASSIGN(CubicBezierTimingFunction); | 64 DISALLOW_ASSIGN(CubicBezierTimingFunction); |
58 }; | 65 }; |
59 | 66 |
60 class CC_EXPORT EaseTimingFunction { | 67 class CC_EXPORT EaseTimingFunction { |
61 public: | 68 public: |
62 static std::unique_ptr<TimingFunction> Create(); | 69 static std::unique_ptr<TimingFunction> Create(); |
63 | 70 |
64 private: | 71 private: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 private: | 118 private: |
112 int steps_; | 119 int steps_; |
113 float steps_start_offset_; | 120 float steps_start_offset_; |
114 | 121 |
115 DISALLOW_ASSIGN(StepsTimingFunction); | 122 DISALLOW_ASSIGN(StepsTimingFunction); |
116 }; | 123 }; |
117 | 124 |
118 } // namespace cc | 125 } // namespace cc |
119 | 126 |
120 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ | 127 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ |
OLD | NEW |