| 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 15 matching lines...) Expand all Loading... |
| 26 // one element can have an impl-only scroll offset animation at any given time. | 26 // one element can have an impl-only scroll offset animation at any given time. |
| 27 // Note that this class only exists on the compositor thread. | 27 // Note that this class only exists on the compositor thread. |
| 28 class CC_EXPORT ScrollOffsetAnimationsImpl : public AnimationDelegate { | 28 class CC_EXPORT ScrollOffsetAnimationsImpl : 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 void ScrollAnimationCreate(ElementId element_id, | 34 void ScrollAnimationCreate(ElementId element_id, |
| 35 const gfx::ScrollOffset& target_offset, | 35 const gfx::ScrollOffset& target_offset, |
| 36 const gfx::ScrollOffset& current_offset); | 36 const gfx::ScrollOffset& current_offset, |
| 37 base::TimeDelta delayed_by); |
| 37 | 38 |
| 38 bool ScrollAnimationUpdateTarget(ElementId element_id, | 39 bool ScrollAnimationUpdateTarget(ElementId element_id, |
| 39 const gfx::Vector2dF& scroll_delta, | 40 const gfx::Vector2dF& scroll_delta, |
| 40 const gfx::ScrollOffset& max_scroll_offset, | 41 const gfx::ScrollOffset& max_scroll_offset, |
| 41 base::TimeTicks frame_monotonic_time); | 42 base::TimeTicks frame_monotonic_time, |
| 43 base::TimeDelta delayed_by); |
| 42 | 44 |
| 43 // Aborts the currently running scroll offset animation on an element and | 45 // Aborts the currently running scroll offset animation on an element and |
| 44 // starts a new one offsetted by adjustment. | 46 // starts a new one offsetted by adjustment. |
| 45 void ScrollAnimationApplyAdjustment(ElementId element_id, | 47 void ScrollAnimationApplyAdjustment(ElementId element_id, |
| 46 const gfx::Vector2dF& adjustment); | 48 const gfx::Vector2dF& adjustment); |
| 47 | 49 |
| 48 void ScrollAnimationAbort(bool needs_completion); | 50 void ScrollAnimationAbort(bool needs_completion); |
| 49 | 51 |
| 50 // AnimationDelegate implementation. | 52 // AnimationDelegate implementation. |
| 51 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 53 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 73 // I.e. only one element can have an impl-only scroll offset animation at | 75 // I.e. only one element can have an impl-only scroll offset animation at |
| 74 // any given time. | 76 // any given time. |
| 75 scoped_refptr<AnimationPlayer> scroll_offset_animation_player_; | 77 scoped_refptr<AnimationPlayer> scroll_offset_animation_player_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationsImpl); | 79 DISALLOW_COPY_AND_ASSIGN(ScrollOffsetAnimationsImpl); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace cc | 82 } // namespace cc |
| 81 | 83 |
| 82 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ | 84 #endif // CC_ANIMATION_SCROLL_OFFSET_ANIMATIONS_IMPL_H_ |
| OLD | NEW |