Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1297363004: cc: Move animate steps from proxies to LayerTreeHostImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moveanimatecodetolthi: . Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698