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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 f913c1f1a011994ba0baa9674946907a784e7e26..4a079f3d47bddd43b4e5184b6d255ff2ae2367bf 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 true;
+}
+
void SingleThreadProxy::SetLayerTreeHostClientReady() {
TRACE_EVENT0("cc", "SingleThreadProxy::SetLayerTreeHostClientReady");
// Scheduling is controlled by the embedder in the single thread case, so
@@ -240,8 +246,6 @@ void SingleThreadProxy::DoCommit() {
layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get());
- layer_tree_host_impl_->CommitComplete();
-
#if DCHECK_IS_ON()
// In the single-threaded case, the scale and scroll deltas should never be
// touched on the impl layer tree.
@@ -250,18 +254,17 @@ void SingleThreadProxy::DoCommit() {
DCHECK(!scroll_info->scrolls.size());
DCHECK_EQ(1.f, scroll_info->page_scale_delta);
#endif
- }
- 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
- // 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.
- NotifyReadyToActivate();
- } else {
- CommitComplete();
+ if (layer_tree_host_->settings().impl_side_painting) {
+ // 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.
+ NotifyReadyToActivate();
+ } else {
+ CommitComplete();
+ }
}
}
@@ -270,6 +273,10 @@ void SingleThreadProxy::CommitComplete() {
<< "Activation is expected to have synchronously occurred by now.";
DCHECK(commit_blocking_task_runner_);
+ // Notify commit complete on the impl side after activate to satisfy any
+ // SetNextCommitWaitsForActivation calls.
+ layer_tree_host_impl_->CommitComplete();
+
DebugScopedSetMainThread main(this);
commit_blocking_task_runner_.reset();
layer_tree_host_->CommitComplete();
@@ -433,8 +440,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();
// Synchronously call to CommitComplete. Resetting
@@ -542,7 +549,8 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
}
}
-void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const {
+void SingleThreadProxy::AsValueInto(
+ base::trace_event::TracedValue* state) const {
// The following line casts away const modifiers because it is just
// setting debug state. We still want the AsValue() function and its
// call chain to be const throughout.
« 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