Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index b5493224ee1d7787ba6115ca5b03efa7afd284f1..873d71d679921f01ad0c76f5055b7be99f9faf9f 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -242,7 +242,7 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
| frame_timing_tracker_(FrameTimingTracker::Create(this)) { |
| if (settings.use_compositor_animation_timelines) { |
| if (settings.accelerated_animation_enabled) { |
| - animation_host_ = AnimationHost::Create(); |
| + animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); |
| animation_host_->SetMutatorHostClient(this); |
| animation_host_->SetSupportsScrollAnimations( |
| proxy_->SupportsImplScrolling()); |
| @@ -3440,6 +3440,10 @@ void LayerTreeHostImpl::ScrollAnimationCreate( |
| LayerImpl* layer_impl, |
| const gfx::ScrollOffset& target_offset, |
| const gfx::ScrollOffset& current_offset) { |
| + if (animation_host_) |
|
Ian Vollick
2015/07/08 00:42:25
An early return in a void function is weird. Was t
Ian Vollick
2015/07/08 00:46:14
(Err, returning the result of ImplOnlyScrollAnimat
loyso (OOO)
2015/07/08 01:13:45
Yes, this is intended. Combined it into just one s
|
| + return animation_host_->ImplOnlyScrollAnimationCreate( |
| + layer_impl->id(), target_offset, current_offset); |
| + |
| scoped_ptr<ScrollOffsetAnimationCurve> curve = |
| ScrollOffsetAnimationCurve::Create(target_offset, |
| EaseInOutTimingFunction::Create()); |
| @@ -3456,6 +3460,11 @@ void LayerTreeHostImpl::ScrollAnimationCreate( |
| bool LayerTreeHostImpl::ScrollAnimationUpdateTarget( |
| LayerImpl* layer_impl, |
| const gfx::Vector2dF& scroll_delta) { |
| + if (animation_host_) |
| + return animation_host_->ImplOnlyScrollAnimationUpdateTarget( |
| + layer_impl->id(), scroll_delta, layer_impl->MaxScrollOffset(), |
| + CurrentBeginFrameArgs().frame_time); |
| + |
| Animation* animation = |
| layer_impl->layer_animation_controller() |
| ? layer_impl->layer_animation_controller()->GetAnimation( |
| @@ -3592,4 +3601,19 @@ void LayerTreeHostImpl::SetLayerScrollOffsetMutated( |
| } |
| } |
| +void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { |
| + ScrollEnd(); |
| +} |
| + |
| +gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation( |
| + int layer_id) const { |
| + if (active_tree()) { |
| + LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); |
| + if (layer) |
| + return layer->ScrollOffsetForAnimation(); |
| + } |
| + |
| + return gfx::ScrollOffset(); |
| +} |
| + |
| } // namespace cc |