OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_ANIMATIONS_IMPL_H_ | 5 #ifndef CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ |
6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ | 6 #define CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // We have just one player for impl-only scroll offset animations. I.e. only | 24 // We have just one player for impl-only scroll offset animations. I.e. only |
25 // one element can have an impl-only scroll offset animation at any given time. | 25 // one element can have an impl-only scroll offset animation at any given time. |
26 // Note that this class only exists on the compositor thread. | 26 // Note that this class only exists on the compositor thread. |
27 class CC_ANIMATION_EXPORT ScrollOffsetAnimationsImpl | 27 class CC_ANIMATION_EXPORT ScrollOffsetAnimationsImpl |
28 : public AnimationDelegate { | 28 : public AnimationDelegate { |
29 public: | 29 public: |
30 explicit ScrollOffsetAnimationsImpl(AnimationHost* animation_host); | 30 explicit ScrollOffsetAnimationsImpl(AnimationHost* animation_host); |
31 | 31 |
32 ~ScrollOffsetAnimationsImpl() override; | 32 ~ScrollOffsetAnimationsImpl() override; |
33 | 33 |
| 34 // |delayed_by| shrinks the duration of the |
| 35 // animation. |animation_start_offset| causes us to start the animation |
| 36 // partway through. |
34 void ScrollAnimationCreate(ElementId element_id, | 37 void ScrollAnimationCreate(ElementId element_id, |
35 const gfx::ScrollOffset& target_offset, | 38 const gfx::ScrollOffset& target_offset, |
36 const gfx::ScrollOffset& current_offset, | 39 const gfx::ScrollOffset& current_offset, |
37 base::TimeDelta delayed_by); | 40 base::TimeDelta delayed_by, |
| 41 base::TimeDelta animation_start_offset); |
38 | 42 |
39 bool ScrollAnimationUpdateTarget(ElementId element_id, | 43 bool ScrollAnimationUpdateTarget(ElementId element_id, |
40 const gfx::Vector2dF& scroll_delta, | 44 const gfx::Vector2dF& scroll_delta, |
41 const gfx::ScrollOffset& max_scroll_offset, | 45 const gfx::ScrollOffset& max_scroll_offset, |
42 base::TimeTicks frame_monotonic_time, | 46 base::TimeTicks frame_monotonic_time, |
43 base::TimeDelta delayed_by); | 47 base::TimeDelta delayed_by); |
44 | 48 |
45 // Aborts the currently running scroll offset animation on an element and | 49 // Aborts the currently running scroll offset animation on an element and |
46 // starts a new one offsetted by adjustment. | 50 // starts a new one offsetted by adjustment. |
47 void ScrollAnimationApplyAdjustment(ElementId element_id, | 51 void ScrollAnimationApplyAdjustment(ElementId element_id, |
(...skipping 27 matching lines...) Expand all Loading... |
75 // I.e. only one element can have an impl-only scroll offset animation at | 79 // I.e. only one element can have an impl-only scroll offset animation at |
76 // any given time. | 80 // any given time. |
77 scoped_refptr<AnimationPlayer> scroll_offset_animation_player_; | 81 scoped_refptr<AnimationPlayer> scroll_offset_animation_player_; |
78 | 82 |
79 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationsImpl); | 83 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationsImpl); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace cc | 86 } // namespace cc |
83 | 87 |
84 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ | 88 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ |
OLD | NEW |