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

Unified Diff: cc/trees/thread_proxy.cc

Issue 23593003: cc: Avoid updating animations in the background without an active tree (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase, re-enable tests Created 7 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/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 4892234a42e695c8b25ea9fc223f77d6dcf54944..786b9eda39289ea65cc9d05770c5a5b46f6bb8f4 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -238,11 +238,16 @@ void ThreadProxy::SetVisibleOnImplThread(CompletionEvent* completion,
TRACE_EVENT0("cc", "ThreadProxy::SetVisibleOnImplThread");
layer_tree_host_impl_->SetVisible(visible);
scheduler_on_impl_thread_->SetVisible(visible);
- layer_tree_host_impl_->UpdateBackgroundAnimateTicking(
- !scheduler_on_impl_thread_->WillDrawIfNeeded());
+ UpdateBackgroundAnimateTicking();
completion->Signal();
}
+void ThreadProxy::UpdateBackgroundAnimateTicking() {
+ layer_tree_host_impl_->UpdateBackgroundAnimateTicking(
+ !scheduler_on_impl_thread_->WillDrawIfNeeded() &&
+ layer_tree_host_impl_->active_tree()->root_layer());
enne (OOO) 2013/08/29 00:10:10 This seems a little redundant. Scheduler::WillDra
brianderson 2013/08/29 00:16:04 It's confusing with all the negations going on. Th
+}
+
void ThreadProxy::DoCreateAndInitializeOutputSurface() {
TRACE_EVENT0("cc", "ThreadProxy::DoCreateAndInitializeOutputSurface");
DCHECK(IsMainThread());
@@ -406,8 +411,7 @@ void ThreadProxy::OnCanDrawStateChanged(bool can_draw) {
TRACE_EVENT1(
"cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
scheduler_on_impl_thread_->SetCanDraw(can_draw);
- layer_tree_host_impl_->UpdateBackgroundAnimateTicking(
- !scheduler_on_impl_thread_->WillDrawIfNeeded());
+ UpdateBackgroundAnimateTicking();
}
void ThreadProxy::NotifyReadyToActivate() {
@@ -928,8 +932,7 @@ void ThreadProxy::ScheduledActionCommit() {
SetInputThrottledUntilCommitOnImplThread(false);
- layer_tree_host_impl_->UpdateBackgroundAnimateTicking(
- !scheduler_on_impl_thread_->WillDrawIfNeeded());
+ UpdateBackgroundAnimateTicking();
next_frame_is_newly_committed_frame_on_impl_thread_ = true;
@@ -1002,7 +1005,7 @@ ThreadProxy::ScheduledActionDrawAndSwapInternal(bool forced_draw) {
if (layer_tree_host_impl_->pending_tree())
layer_tree_host_impl_->pending_tree()->UpdateDrawProperties();
layer_tree_host_impl_->Animate(monotonic_time, wall_clock_time);
- layer_tree_host_impl_->UpdateBackgroundAnimateTicking(false);
+ UpdateBackgroundAnimateTicking();
base::TimeTicks start_time = base::TimeTicks::HighResNow();
base::TimeDelta draw_duration_estimate = DrawDurationEstimate();
@@ -1049,7 +1052,6 @@ ThreadProxy::ScheduledActionDrawAndSwapInternal(bool forced_draw) {
result.did_draw = true;
}
layer_tree_host_impl_->DidDrawAllLayers(frame);
-
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
// Check for a pending CompositeAndReadback.
@@ -1500,6 +1502,8 @@ void ThreadProxy::DidActivatePendingTree() {
completion_event_for_commit_held_on_tree_activation_ = NULL;
}
+ UpdateBackgroundAnimateTicking();
+
commit_to_activate_duration_history_.InsertSample(
base::TimeTicks::HighResNow() - commit_complete_time_);
}
« 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