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

Unified Diff: cc/trees/thread_proxy.cc

Issue 713783002: Revert of Moving background animation ticking from LayerTreeHostImpl into the Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler-timesource-refactor
Patch Set: Created 6 years, 1 month 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/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 65e8dd27a35de390d404d951d5b701fc56dc5224..37830f601dd0ce1351ecddc55fb0bd6b59b7dd1c 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -176,7 +176,16 @@
TRACE_EVENT0("cc", "ThreadProxy::SetVisibleOnImplThread");
impl().layer_tree_host_impl->SetVisible(visible);
impl().scheduler->SetVisible(visible);
+ UpdateBackgroundAnimateTicking();
completion->Signal();
+}
+
+void ThreadProxy::UpdateBackgroundAnimateTicking() {
+ bool should_background_tick =
+ !impl().scheduler->WillDrawIfNeeded() &&
+ impl().layer_tree_host_impl->active_tree()->root_layer();
+ impl().layer_tree_host_impl->UpdateBackgroundAnimateTicking(
+ should_background_tick);
}
void ThreadProxy::DidLoseOutputSurface() {
@@ -349,6 +358,7 @@
"cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
DCHECK(IsImplThread());
impl().scheduler->SetCanDraw(can_draw);
+ UpdateBackgroundAnimateTicking();
}
void ThreadProxy::NotifyReadyToActivate() {
@@ -917,22 +927,9 @@
TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate");
DCHECK(IsImplThread());
- // Don't animate if there is no root layer.
- // TODO(mithro): Both Animate and UpdateAnimationState already have a
- // "!active_tree_->root_layer()" check?
- if (!impl().layer_tree_host_impl->active_tree()->root_layer()) {
- return;
- }
-
impl().animation_time =
impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time;
impl().layer_tree_host_impl->Animate(impl().animation_time);
-
- // If animations are not visible, update the state now as
- // ScheduledActionDrawAndSwapIfPossible will never be called.
- if (!impl().layer_tree_host_impl->AnimationsAreVisible()) {
- impl().layer_tree_host_impl->UpdateAnimationState(true);
- }
}
void ThreadProxy::ScheduledActionCommit() {
@@ -975,6 +972,8 @@
impl().layer_tree_host_impl->CommitComplete();
SetInputThrottledUntilCommitOnImplThread(false);
+
+ UpdateBackgroundAnimateTicking();
impl().next_frame_is_newly_committed_frame = true;
@@ -1353,6 +1352,8 @@
impl().completion_event_for_commit_held_on_tree_activation = NULL;
}
+ UpdateBackgroundAnimateTicking();
+
impl().timing_history.DidActivateSyncTree();
}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698