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 |
| 5 #ifndef CCTimingFunction_h |
| 6 #define CCTimingFunction_h |
| 7 |
| 8 #include "CCAnimationCurve.h" |
| 9 #include "UnitBezier.h" |
| 10 |
| 11 namespace cc { |
| 12 |
| 13 // See http://www.w3.org/TR/css3-transitions/. |
| 14 class CCTimingFunction : public CCFloatAnimationCurve { |
| 15 public: |
| 16 virtual ~CCTimingFunction(); |
| 17 |
| 18 // Partial implementation of CCFloatAnimationCurve. |
| 19 virtual double duration() const OVERRIDE; |
| 20 |
| 21 protected: |
| 22 CCTimingFunction(); |
| 23 }; |
| 24 |
| 25 class CCCubicBezierTimingFunction : public CCTimingFunction { |
| 26 public: |
| 27 static scoped_ptr<CCCubicBezierTimingFunction> create(double x1, double y1,
double x2, double y2); |
| 28 virtual ~CCCubicBezierTimingFunction(); |
| 29 |
| 30 // Partial implementation of CCFloatAnimationCurve. |
| 31 virtual float getValue(double time) const OVERRIDE; |
| 32 virtual scoped_ptr<CCAnimationCurve> clone() const OVERRIDE; |
| 33 |
| 34 protected: |
| 35 CCCubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
| 36 |
| 37 UnitBezier m_curve; |
| 38 }; |
| 39 |
| 40 class CCEaseTimingFunction { |
| 41 public: |
| 42 static scoped_ptr<CCTimingFunction> create(); |
| 43 }; |
| 44 |
| 45 class CCEaseInTimingFunction { |
| 46 public: |
| 47 static scoped_ptr<CCTimingFunction> create(); |
| 48 }; |
| 49 |
| 50 class CCEaseOutTimingFunction { |
| 51 public: |
| 52 static scoped_ptr<CCTimingFunction> create(); |
| 53 }; |
| 54 |
| 55 class CCEaseInOutTimingFunction { |
| 56 public: |
| 57 static scoped_ptr<CCTimingFunction> create(); |
| 58 }; |
| 59 |
| 60 } // namespace cc |
| 61 |
| 62 #endif // CCTimingFunction_h |
OLD | NEW |