| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 5 #ifndef CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
| 6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" |
| 9 #include "cc/animation/animation_curve.h" | 10 #include "cc/animation/animation_curve.h" |
| 10 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 11 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 | 14 |
| 14 class TimingFunction; | 15 class TimingFunction; |
| 15 | 16 |
| 16 class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { | 17 class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { |
| 17 public: | 18 public: |
| 18 static scoped_ptr<ScrollOffsetAnimationCurve> Create( | 19 static scoped_ptr<ScrollOffsetAnimationCurve> Create( |
| 19 const gfx::Vector2dF& target_value, | 20 const gfx::Vector2dF& target_value, |
| 20 scoped_ptr<TimingFunction> timing_function); | 21 scoped_ptr<TimingFunction> timing_function); |
| 21 | 22 |
| 22 virtual ~ScrollOffsetAnimationCurve(); | 23 virtual ~ScrollOffsetAnimationCurve(); |
| 23 | 24 |
| 24 void SetInitialValue(const gfx::Vector2dF& initial_value); | 25 void SetInitialValue(const gfx::Vector2dF& initial_value); |
| 25 gfx::Vector2dF GetValue(double t) const; | 26 gfx::Vector2dF GetValue(double t) const; |
| 26 | 27 |
| 27 // AnimationCurve implementation | 28 // AnimationCurve implementation |
| 28 virtual double Duration() const OVERRIDE; | 29 virtual double Duration() const OVERRIDE; |
| 29 virtual CurveType Type() const OVERRIDE; | 30 virtual CurveType Type() const OVERRIDE; |
| 30 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; | 31 virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE; |
| 31 | 32 |
| 32 private: | 33 private: |
| 33 ScrollOffsetAnimationCurve(const gfx::Vector2dF& target_value, | 34 ScrollOffsetAnimationCurve(const gfx::Vector2dF& target_value, |
| 34 scoped_ptr <TimingFunction> timing_function); | 35 scoped_ptr <TimingFunction> timing_function); |
| 35 | 36 |
| 36 gfx::Vector2dF initial_value_; | 37 gfx::Vector2dF initial_value_; |
| 37 gfx::Vector2dF target_value_; | 38 gfx::Vector2dF target_value_; |
| 38 double duration_; | 39 base::TimeDelta duration_; |
| 39 | 40 |
| 40 scoped_ptr<TimingFunction> timing_function_; | 41 scoped_ptr<TimingFunction> timing_function_; |
| 41 | 42 |
| 42 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); | 43 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace cc | 46 } // namespace cc |
| 46 | 47 |
| 47 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 48 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
| OLD | NEW |