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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 60513007: Add SwapPromise support to LayerTreeHost and LayerTreeImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add comments for when to use QueueSwapPromise() Created 7 years, 1 month 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 9de0fdd8d85d4dcd56686de2cd599ffaf1266559..4a0ca66da591a2063228bc1067c26ed1d0d5d8f3 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -377,7 +377,11 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
// the swap buffers will execute first.
BlockingTaskRunner::CapturePostTasks blocked;
- layer_tree_host_impl_->SwapBuffers(frame);
+ bool did_swap = layer_tree_host_impl_->SwapBuffers(frame);
+ if (did_swap)
+ layer_tree_host_impl_->active_tree()->FinishSwapPromise();
+ else
+ layer_tree_host_impl_->active_tree()->BreakSwapPromise("DID NOT SWAP");
}
DidSwapFrame();
}

Powered by Google App Engine
This is Rietveld 408576698