| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 void SetInitialValue(const gfx::ScrollOffset& initial_value); | 29 void SetInitialValue(const gfx::ScrollOffset& initial_value); |
| 30 bool HasSetInitialValue() const; | 30 bool HasSetInitialValue() const; |
| 31 gfx::ScrollOffset GetValue(base::TimeDelta t) const; | 31 gfx::ScrollOffset GetValue(base::TimeDelta t) const; |
| 32 gfx::ScrollOffset target_value() const { return target_value_; } | 32 gfx::ScrollOffset target_value() const { return target_value_; } |
| 33 void UpdateTarget(double t, const gfx::ScrollOffset& new_target); | 33 void UpdateTarget(double t, const gfx::ScrollOffset& new_target); |
| 34 | 34 |
| 35 // AnimationCurve implementation | 35 // AnimationCurve implementation |
| 36 base::TimeDelta Duration() const override; | 36 base::TimeDelta Duration() const override; |
| 37 CurveType Type() const override; | 37 CurveType Type() const override; |
| 38 scoped_ptr<AnimationCurve> Clone() const override; | 38 scoped_ptr<AnimationCurve> Clone() const override; |
| 39 scoped_ptr<ScrollOffsetAnimationCurve> CloneToScrollOffsetAnimationCurve() |
| 40 const; |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value, | 43 ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value, |
| 42 scoped_ptr<TimingFunction> timing_function, | 44 scoped_ptr<TimingFunction> timing_function, |
| 43 DurationBehavior); | 45 DurationBehavior); |
| 44 | 46 |
| 45 gfx::ScrollOffset initial_value_; | 47 gfx::ScrollOffset initial_value_; |
| 46 gfx::ScrollOffset target_value_; | 48 gfx::ScrollOffset target_value_; |
| 47 base::TimeDelta total_animation_duration_; | 49 base::TimeDelta total_animation_duration_; |
| 48 | 50 |
| 49 // Time from animation start to most recent UpdateTarget. | 51 // Time from animation start to most recent UpdateTarget. |
| 50 base::TimeDelta last_retarget_; | 52 base::TimeDelta last_retarget_; |
| 51 | 53 |
| 52 scoped_ptr<TimingFunction> timing_function_; | 54 scoped_ptr<TimingFunction> timing_function_; |
| 53 DurationBehavior duration_behavior_; | 55 DurationBehavior duration_behavior_; |
| 54 | 56 |
| 55 bool has_set_initial_value_; | 57 bool has_set_initial_value_; |
| 56 | 58 |
| 57 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); | 59 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 } // namespace cc | 62 } // namespace cc |
| 61 | 63 |
| 62 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 64 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
| OLD | NEW |