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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 873473006: cc: Commit directly to active tree when using single thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 7d5689f1ddb87903474126621bfcd6c1dd71f40d..66522eaa0c4df55bd6732e83eb08f33ac37fd270 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -82,6 +82,12 @@ bool SingleThreadProxy::IsStarted() const {
return layer_tree_host_impl_;
}
+bool SingleThreadProxy::CommitToActiveTree() const {
+ // With SingleThreadProxy we skip the pending tree and commit directly to the
+ // active tree.
+ return false;
enne (OOO) 2015/01/28 01:14:53 ...false?!
danakj 2015/01/28 01:28:20 Oh thats why my unittests started passing. thanks
+}
+
void SingleThreadProxy::SetLayerTreeHostClientReady() {
TRACE_EVENT0("cc", "SingleThreadProxy::SetLayerTreeHostClientReady");
// Scheduling is controlled by the embedder in the single thread case, so
@@ -250,9 +256,8 @@ void SingleThreadProxy::DoCommit() {
}
if (layer_tree_host_->settings().impl_side_painting) {
- // TODO(enne): just commit directly to the active tree.
- //
- // Synchronously activate during commit to satisfy any potential
+ // Commit goes directly to the active tree, but we need to synchronously
+ // "activate" the tree still during commit to satisfy any potential
// SetNextCommitWaitsForActivation calls. Unfortunately, the tree
// might not be ready to draw, so DidActivateSyncTree must set
// the flag to force the tree to not draw until textures are ready.
@@ -433,8 +438,8 @@ void SingleThreadProxy::DidActivateSyncTree() {
// Non-impl-side painting finishes commit in DoCommit. Impl-side painting
// defers until here to simulate SetNextCommitWaitsForActivation.
if (layer_tree_host_impl_->settings().impl_side_painting) {
- // This is required because NotifyReadyToActivate gets called when
- // the pending tree is not actually ready in the SingleThreadProxy.
+ // This is required because NotifyReadyToActivate gets called immediately
+ // after commit since single thread commits directly to the active tree.
layer_tree_host_impl_->SetRequiresHighResToDraw();
CommitComplete();
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698