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 f394d52494ea5750809c128277c1f25afb07d363..f2efc54af1e5f4df2420fe32d3a40a65bc15a83e 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -399,8 +399,7 @@ bool LayerTreeHostImpl::CanDraw() const { |
| } |
| void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time) { |
| - if (input_handler_client_) |
| - input_handler_client_->Animate(monotonic_time); |
| + AnimateFling(monotonic_time); |
|
mkosiba (inactive)
2014/05/15 13:48:51
I don't think we want to call this at all if layer
jdduke (slow)
2014/05/15 14:15:43
Oops yeah that's definitely what I had planned.
|
| AnimatePageScale(monotonic_time); |
| AnimateLayers(monotonic_time); |
| AnimateScrollbars(monotonic_time); |
| @@ -471,6 +470,19 @@ void LayerTreeHostImpl::StartPageScaleAnimation( |
| client_->RenewTreePriority(); |
| } |
| +void LayerTreeHostImpl::SetNeedsAnimateFling() { |
| + if (root_layer_scroll_offset_delegate_ && |
| + (CurrentlyScrollingLayer() == InnerViewportScrollLayer() || |
| + CurrentlyScrollingLayer() == OuterViewportScrollLayer())) { |
| + // Hacky callback approach... |
| + root_layer_scroll_offset_delegate_->SetNeedsAnimate( |
| + base::Bind(&LayerTreeHostImpl::AnimateFling, AsWeakPtr())); |
| + return; |
| + } |
| + |
| + SetNeedsAnimate(); |
| +} |
| + |
| bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt( |
| const gfx::Point& viewport_point, |
| InputHandler::ScrollInputType type) { |
| @@ -2758,6 +2770,12 @@ void LayerTreeHostImpl::ScrollViewportBy(gfx::Vector2dF scroll_delta) { |
| InnerViewportScrollLayer()->ScrollBy(unused_delta); |
| } |
| +void LayerTreeHostImpl::AnimateFling(base::TimeTicks monotonic_time) { |
| + DCHECK(proxy_->IsImplThread()); |
| + if (input_handler_client_) |
| + input_handler_client_->AnimateFling(monotonic_time); |
| +} |
| + |
| void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks monotonic_time) { |
| if (!page_scale_animation_) |
| return; |