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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 2188093002: cc: Complete swap promise for aborted commit after pending activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error Created 4 years, 5 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
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 5b0fb57027e476c8eb01c62f718c3d1a2a639ce2..79ded3416cb6f7cbee9d86092c3336fe4e80d9ef 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -378,8 +378,8 @@ void SingleThreadProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) {
}
void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) {
- TRACE_EVENT1(
- "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
+ TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw",
+ can_draw);
DCHECK(task_runner_provider_->IsImplThread());
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->SetCanDraw(can_draw);
@@ -448,7 +448,9 @@ void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread(
layer_tree_host_->SetAnimationEvents(std::move(events));
}
-bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; }
+bool SingleThreadProxy::IsInsideDraw() {
+ return inside_draw_;
+}
void SingleThreadProxy::DidActivateSyncTree() {
// Synchronously call to CommitComplete. Resetting
@@ -594,8 +596,7 @@ bool SingleThreadProxy::SupportsImplScrolling() const {
bool SingleThreadProxy::ShouldComposite() const {
DCHECK(task_runner_provider_->IsImplThread());
- return layer_tree_host_impl_->visible() &&
- layer_tree_host_impl_->CanDraw();
+ return layer_tree_host_impl_->visible() && layer_tree_host_impl_->CanDraw();
}
void SingleThreadProxy::ScheduleRequestNewOutputSurface() {
@@ -735,13 +736,13 @@ void SingleThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) {
void SingleThreadProxy::ScheduledActionSendBeginMainFrame(
const BeginFrameArgs& begin_frame_args) {
TRACE_EVENT0("cc", "SingleThreadProxy::ScheduledActionSendBeginMainFrame");
- // Although this proxy is single-threaded, it's problematic to synchronously
- // have BeginMainFrame happen after ScheduledActionSendBeginMainFrame. This
- // could cause a commit to occur in between a series of SetNeedsCommit calls
- // (i.e. property modifications) causing some to fall on one frame and some to
- // fall on the next. Doing it asynchronously instead matches the semantics of
- // ThreadProxy::SetNeedsCommit where SetNeedsCommit will not cause a
- // synchronous commit.
+// Although this proxy is single-threaded, it's problematic to synchronously
+// have BeginMainFrame happen after ScheduledActionSendBeginMainFrame. This
+// could cause a commit to occur in between a series of SetNeedsCommit calls
+// (i.e. property modifications) causing some to fall on one frame and some to
+// fall on the next. Doing it asynchronously instead matches the semantics of
+// ThreadProxy::SetNeedsCommit where SetNeedsCommit will not cause a
+// synchronous commit.
brianderson 2016/07/28 18:10:53 Should this go inside the dcheck and be indented?
sunnyps 2016/08/02 02:55:09 Done.
#if DCHECK_IS_ON()
DCHECK(inside_impl_frame_)
<< "BeginMainFrame should only be sent inside a BeginImplFrame";
@@ -785,8 +786,8 @@ void SingleThreadProxy::BeginMainFrame(const BeginFrameArgs& begin_frame_args) {
}
if (layer_tree_host_->output_surface_lost()) {
- TRACE_EVENT_INSTANT0(
- "cc", "EarlyOut_OutputSurfaceLost", TRACE_EVENT_SCOPE_THREAD);
+ TRACE_EVENT_INSTANT0("cc", "EarlyOut_OutputSurfaceLost",
+ TRACE_EVENT_SCOPE_THREAD);
BeginMainFrameAbortedOnImplThread(
CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST);
return;
@@ -825,7 +826,9 @@ void SingleThreadProxy::BeginMainFrameAbortedOnImplThread(
DCHECK(scheduler_on_impl_thread_->CommitPending());
DCHECK(!layer_tree_host_impl_->pending_tree());
- layer_tree_host_impl_->BeginMainFrameAborted(reason);
+ std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises;
+ layer_tree_host_impl_->BeginMainFrameAborted(reason,
+ std::move(empty_swap_promises));
scheduler_on_impl_thread_->BeginMainFrameAborted(reason);
}

Powered by Google App Engine
This is Rietveld 408576698