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 "cc/animation/animation_curve.h" | 8 #include "cc/animation/animation_curve.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "third_party/skia/include/core/SkScalar.h" | 10 #include "ui/gfx/geometry/cubic_bezier.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 // See http://www.w3.org/TR/css3-transitions/. | 14 // See http://www.w3.org/TR/css3-transitions/. |
15 class CC_EXPORT TimingFunction : public FloatAnimationCurve { | 15 class CC_EXPORT TimingFunction : public FloatAnimationCurve { |
16 public: | 16 public: |
17 virtual ~TimingFunction(); | 17 virtual ~TimingFunction(); |
18 | 18 |
19 // Partial implementation of FloatAnimationCurve. | 19 // Partial implementation of FloatAnimationCurve. |
20 virtual double Duration() const OVERRIDE; | 20 virtual double Duration() const OVERRIDE; |
(...skipping 17 matching lines...) Expand all Loading... |
38 | 38 |
39 // Partial implementation of FloatAnimationCurve. | 39 // Partial implementation of FloatAnimationCurve. |
40 virtual float GetValue(double time) const OVERRIDE; | 40 virtual float GetValue(double time) const OVERRIDE; |
41 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 41 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; |
42 | 42 |
43 virtual void Range(float* min, float* max) const OVERRIDE; | 43 virtual void Range(float* min, float* max) const OVERRIDE; |
44 | 44 |
45 protected: | 45 protected: |
46 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); | 46 CubicBezierTimingFunction(double x1, double y1, double x2, double y2); |
47 | 47 |
48 double x1_; | 48 gfx::CubicBezier bezier_; |
49 double y1_; | |
50 double x2_; | |
51 double y2_; | |
52 | 49 |
53 private: | 50 private: |
54 DISALLOW_ASSIGN(CubicBezierTimingFunction); | 51 DISALLOW_ASSIGN(CubicBezierTimingFunction); |
55 }; | 52 }; |
56 | 53 |
57 class CC_EXPORT EaseTimingFunction { | 54 class CC_EXPORT EaseTimingFunction { |
58 public: | 55 public: |
59 static scoped_ptr<TimingFunction> Create(); | 56 static scoped_ptr<TimingFunction> Create(); |
60 | 57 |
61 private: | 58 private: |
(...skipping 20 matching lines...) Expand all Loading... |
82 public: | 79 public: |
83 static scoped_ptr<TimingFunction> Create(); | 80 static scoped_ptr<TimingFunction> Create(); |
84 | 81 |
85 private: | 82 private: |
86 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction); | 83 DISALLOW_IMPLICIT_CONSTRUCTORS(EaseInOutTimingFunction); |
87 }; | 84 }; |
88 | 85 |
89 } // namespace cc | 86 } // namespace cc |
90 | 87 |
91 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ | 88 #endif // CC_ANIMATION_TIMING_FUNCTION_H_ |
OLD | NEW |