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

Unified Diff: cc/trees/thread_proxy.cc

Issue 22320019: cc: Start commit early and block on tree activation (Closed) Base URL: http://git.chromium.org/chromium/src.git@usedl26
Patch Set: 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 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())
« 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