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 49d1821787640761978091156b8ddef5f12f3ce6..d3e03a5cc2aa6ed9fc6b9ddb0c8882a789b86959 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -421,20 +421,33 @@ bool LayerTreeHostImpl::CanDraw() const { |
| return true; |
| } |
| -void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time) { |
| +void LayerTreeHostImpl::Animate() { |
| + // Don't animate if there is no active root layer. |
| + // TODO(ajuma): Does this break things if first commit has an animation? |
|
ajuma
2015/08/19 21:05:02
I suspect it will if break things if we move post-
|
| + if (!active_tree()->root_layer()) |
| + return; |
| + |
| + base::TimeTicks monotonic_time = CurrentBeginFrameArgs().frame_time; |
| + |
| // mithro(TODO): Enable these checks. |
| // DCHECK(!current_begin_frame_tracker_.HasFinished()); |
| // DCHECK(monotonic_time == current_begin_frame_tracker_.Current().frame_time) |
| // << "Called animate with unknown frame time!?"; |
| if (!root_layer_scroll_offset_delegate_ || |
| (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && |
| - CurrentlyScrollingLayer() != OuterViewportScrollLayer())) { |
| + CurrentlyScrollingLayer() != OuterViewportScrollLayer())) |
| AnimateInput(monotonic_time); |
| - } |
| AnimatePageScale(monotonic_time); |
| AnimateLayers(monotonic_time); |
| AnimateScrollbars(monotonic_time); |
| AnimateTopControls(monotonic_time); |
| + |
| + // If animations are not visible, update the state now as Draw/Swap will never |
| + // occur. |
| + // TODO(ajuma): Left-overs from now-deleted background ticking? |
|
ajuma
2015/08/19 21:05:02
Sure looks like it.
|
| + bool animations_are_visible = visible() && CanDraw(); |
| + if (!animations_are_visible) |
| + UpdateAnimationState(true); |
| } |
| bool LayerTreeHostImpl::PrepareTiles() { |