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