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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "cc/animation/animation_curve.h" | 12 #include "cc/animation/animation_curve.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/animation/animation_export.h" |
14 #include "ui/gfx/geometry/scroll_offset.h" | 14 #include "ui/gfx/geometry/scroll_offset.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class TimingFunction; | 18 class TimingFunction; |
19 | 19 |
20 class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { | 20 class CC_ANIMATION_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { |
21 public: | 21 public: |
22 enum class DurationBehavior { DELTA_BASED, CONSTANT, INVERSE_DELTA }; | 22 enum class DurationBehavior { DELTA_BASED, CONSTANT, INVERSE_DELTA }; |
23 static std::unique_ptr<ScrollOffsetAnimationCurve> Create( | 23 static std::unique_ptr<ScrollOffsetAnimationCurve> Create( |
24 const gfx::ScrollOffset& target_value, | 24 const gfx::ScrollOffset& target_value, |
25 std::unique_ptr<TimingFunction> timing_function, | 25 std::unique_ptr<TimingFunction> timing_function, |
26 DurationBehavior = DurationBehavior::DELTA_BASED); | 26 DurationBehavior = DurationBehavior::DELTA_BASED); |
27 | 27 |
28 static base::TimeDelta SegmentDuration(const gfx::Vector2dF& delta, | 28 static base::TimeDelta SegmentDuration(const gfx::Vector2dF& delta, |
29 DurationBehavior behavior, | 29 DurationBehavior behavior, |
30 base::TimeDelta delayed_by); | 30 base::TimeDelta delayed_by); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 DurationBehavior duration_behavior_; | 62 DurationBehavior duration_behavior_; |
63 | 63 |
64 bool has_set_initial_value_; | 64 bool has_set_initial_value_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); | 66 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationCurve); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace cc | 69 } // namespace cc |
70 | 70 |
71 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ | 71 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_ |
OLD | NEW |