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

Unified Diff: cc/trees/layer_tree_host_impl.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: Add DCHECKs, fix SingleThreadProxy 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 | « no previous file | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | cc/trees/single_thread_proxy.cc » ('J')
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 5546ea33d36ce5773120089d2538164aaec607e9..9454e32bc65c3917629f23735c2eb8ca2003969e 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -128,6 +128,10 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient {
time_source_->SetActive(active);
}
+ bool Active() const {
+ return time_source_->Active();
+ }
+
private:
LayerTreeHostImplTimeSourceAdapter(
LayerTreeHostImpl* layer_tree_host_impl,
@@ -256,6 +260,8 @@ void LayerTreeHostImpl::CommitComplete() {
ManageTiles();
} else {
active_tree_->set_needs_update_draw_properties();
+ if (time_source_client_adapter_ && time_source_client_adapter_->Active())
+ DCHECK(active_tree_->root_layer());
}
client_->SendManagedMemoryStats();
@@ -825,6 +831,8 @@ void LayerTreeHostImpl::MainThreadHasStoppedFlinging() {
void LayerTreeHostImpl::UpdateBackgroundAnimateTicking(
bool should_background_tick) {
DCHECK(proxy_->IsImplThread());
+ if (should_background_tick)
+ DCHECK(active_tree_->root_layer());
bool enabled = should_background_tick &&
!animation_registrar_->active_animation_controllers().empty();
@@ -1503,6 +1511,9 @@ void LayerTreeHostImpl::ActivatePendingTree() {
client_->DidActivatePendingTree();
if (!tree_activation_callback_.is_null())
tree_activation_callback_.Run();
+
+ if (time_source_client_adapter_ && time_source_client_adapter_->Active())
+ DCHECK(active_tree_->root_layer());
}
void LayerTreeHostImpl::SetVisible(bool visible) {
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | cc/trees/single_thread_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698