Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index 73cc55787037b4b6ed0961d258f72b7864d4b1b9..6a0cf1622b19040308dc3f62f08f621997f7a36c 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -433,6 +433,13 @@ void ThreadProxy::OnHasPendingTreeStateChanged(bool has_pending_tree) { |
has_pending_tree, |
layer_tree_host_impl_->active_tree() ? |
!layer_tree_host_impl_->active_tree()->root_layer() : true); |
+ |
+ if (!has_pending_tree && !deferred_start_commit_on_impl_thread_.is_null()) { |
+ Proxy::ImplThreadTaskRunner()->PostTask( |
+ FROM_HERE, |
+ deferred_start_commit_on_impl_thread_); |
+ deferred_start_commit_on_impl_thread_.Reset(); |
+ } |
} |
void ThreadProxy::SetNeedsCommitOnImplThread() { |
@@ -880,6 +887,19 @@ void ThreadProxy::StartCommitOnImplThread( |
return; |
} |
+ // We defer forced commits while there is a pending tree here. |
Sami
2013/08/13 15:56:02
Could this be done in the state machine instead? S
brianderson
2013/09/07 01:18:54
Hmm, I'll give that a try. I did it this way becau
|
+ if (layer_tree_host_impl_->pending_tree()) { |
+ TRACE_EVENT0("cc", "EarlyOut_DeferringDueToPendingTree"); |
+ DCHECK(deferred_start_commit_on_impl_thread_.is_null()); |
+ deferred_start_commit_on_impl_thread_ = |
+ base::Bind(&ThreadProxy::StartCommitOnImplThread, |
+ impl_thread_weak_ptr_, |
+ completion, |
+ raw_queue, |
+ offscreen_context_provider); |
+ return; |
+ } |
+ |
scoped_ptr<ResourceUpdateQueue> queue(raw_queue); |
if (offscreen_context_provider.get()) |