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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 2769213006: cc: If SetDeferCommits(true) happens inside the main frame, abort it. (Closed)
Patch Set: defer-inside-mainframe: comments Created 3 years, 9 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
« cc/trees/layer_tree_host_unittest.cc ('K') | « cc/trees/single_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/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index eeae9b6caf8a2314eff0c5b06a1a0e636cce4da3..d36ef98ee426a3c9f236cb51498d5f2c491f5e0f 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -471,6 +471,7 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
DCHECK(inside_impl_frame_);
#endif
DoBeginMainFrame(begin_frame_args);
+ DoPainting();
DoCommit();
DCHECK_EQ(
@@ -658,6 +659,22 @@ void SingleThreadProxy::BeginMainFrame(const BeginFrameArgs& begin_frame_args) {
commit_requested_ = true;
DoBeginMainFrame(begin_frame_args);
+
+ // New commits requested inside UpdateLayers should be respected.
+ commit_requested_ = false;
+
+ // At this point the main frame may have deferred commits to avoid committing
+ // right now.
+ if (defer_commits_) {
+ TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit_InsideBeginMainFrame",
+ TRACE_EVENT_SCOPE_THREAD);
+ BeginMainFrameAbortedOnImplThread(
+ CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT);
+ layer_tree_host_->DidBeginMainFrame();
+ return;
+ }
+
+ DoPainting();
}
void SingleThreadProxy::DoBeginMainFrame(
@@ -674,10 +691,9 @@ void SingleThreadProxy::DoBeginMainFrame(
layer_tree_host_->BeginMainFrame(begin_frame_args);
layer_tree_host_->AnimateLayers(begin_frame_args.frame_time);
layer_tree_host_->RequestMainFrameUpdate();
+}
- // New commits requested inside UpdateLayers should be respected.
- commit_requested_ = false;
-
+void SingleThreadProxy::DoPainting() {
layer_tree_host_->UpdateLayers();
// TODO(enne): SingleThreadProxy does not support cancelling commits yet,
« cc/trees/layer_tree_host_unittest.cc ('K') | « cc/trees/single_thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698