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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 24078024: cc: Return resources to child compositor via a Callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: deletechild: No AndReceiveAck needed, change STP Created 7 years, 3 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/layer_tree_host_unittest_delegated.cc ('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 689cc452f082e6f9b8ecfac23d00949cbcfe4c21..3d5e7a5f52802fc87e4636c9ff90720393c8d9ce 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -125,7 +125,7 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() {
}
{
- DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
DebugScopedSetImplThread impl(this);
layer_tree_host_->DeleteContentsTexturesOnImplThread(
layer_tree_host_impl_->resource_provider());
@@ -182,7 +182,7 @@ void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
DCHECK(Proxy::IsMainThread());
// Commit immediately.
{
- DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
DebugScopedSetImplThread impl(this);
// This CapturePostTasks should be destroyed before CommitComplete() is
@@ -263,7 +263,7 @@ void SingleThreadProxy::Stop() {
TRACE_EVENT0("cc", "SingleThreadProxy::stop");
DCHECK(Proxy::IsMainThread());
{
- DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
DebugScopedSetImplThread impl(this);
layer_tree_host_->DeleteContentsTexturesOnImplThread(
@@ -365,7 +365,21 @@ void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
device_viewport_damage_rect,
false, // for_readback
&frame)) {
- layer_tree_host_impl_->SwapBuffers(frame);
+ {
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
+ DebugScopedSetImplThread impl(this);
+
+ // This CapturePostTasks should be destroyed before
+ // DidCommitAndDrawFrame() is called since that goes out to the embedder,
+ // and we want the embedder to receive its callbacks before that.
+ // NOTE: This maintains consistent ordering with the ThreadProxy since
+ // the DidCommitAndDrawFrame() must be post-tasked from the impl thread
+ // there as the main thread is not blocked, so any posted tasks inside
+ // the swap buffers will execute first.
+ BlockingTaskRunner::CapturePostTasks blocked;
+
+ layer_tree_host_impl_->SwapBuffers(frame);
+ }
DidSwapFrame();
}
}
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698