| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "platform/scroll/ProgrammaticScrollAnimator.h" | 5 #include "platform/scroll/ProgrammaticScrollAnimator.h" |
| 6 | 6 |
| 7 #include "platform/animation/CompositorAnimation.h" | 7 #include "platform/animation/CompositorAnimation.h" |
| 8 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h" | 8 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h" |
| 9 #include "platform/geometry/IntPoint.h" | 9 #include "platform/geometry/IntPoint.h" |
| 10 #include "platform/graphics/CompositorFactory.h" | 10 #include "platform/graphics/CompositorFactory.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 if (m_runState == RunState::WaitingToCancelOnCompositor) { | 117 if (m_runState == RunState::WaitingToCancelOnCompositor) { |
| 118 resetAnimationState(); | 118 resetAnimationState(); |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 if (m_runState == RunState::WaitingToSendToCompositor) { | 123 if (m_runState == RunState::WaitingToSendToCompositor) { |
| 124 bool sentToCompositor = false; | 124 bool sentToCompositor = false; |
| 125 | 125 |
| 126 if (!m_scrollableArea->shouldScrollOnMainThread()) { | 126 if (!m_scrollableArea->shouldScrollOnMainThread()) { |
| 127 OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory::
current().createAnimation(*m_animationCurve, CompositorAnimation::TargetProperty
ScrollOffset)); | 127 OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory::
current().createAnimation(*m_animationCurve, CompositorTargetProperty::SCROLL_OF
FSET)); |
| 128 | 128 |
| 129 int animationId = animation->id(); | 129 int animationId = animation->id(); |
| 130 int animationGroupId = animation->group(); | 130 int animationGroupId = animation->group(); |
| 131 | 131 |
| 132 if (addAnimation(animation.release())) { | 132 if (addAnimation(animation.release())) { |
| 133 sentToCompositor = true; | 133 sentToCompositor = true; |
| 134 m_runState = RunState::RunningOnCompositor; | 134 m_runState = RunState::RunningOnCompositor; |
| 135 m_compositorAnimationId = animationId; | 135 m_compositorAnimationId = animationId; |
| 136 m_compositorAnimationGroupId = animationGroupId; | 136 m_compositorAnimationGroupId = animationGroupId; |
| 137 } | 137 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(groupId); | 173 ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(groupId); |
| 174 } | 174 } |
| 175 | 175 |
| 176 DEFINE_TRACE(ProgrammaticScrollAnimator) | 176 DEFINE_TRACE(ProgrammaticScrollAnimator) |
| 177 { | 177 { |
| 178 visitor->trace(m_scrollableArea); | 178 visitor->trace(m_scrollableArea); |
| 179 ScrollAnimatorCompositorCoordinator::trace(visitor); | 179 ScrollAnimatorCompositorCoordinator::trace(visitor); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace blink | 182 } // namespace blink |
| OLD | NEW |