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

Unified Diff: cc/trees/thread_proxy.cc

Issue 14273026: cc: Make async readback path use async glRreadPixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forlanding Created 7 years, 8 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/thread_proxy.h ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index ef8cce707f4fb904177cd22f64a4516866075b00..60c045205893ca5a609e642ea1232b7c340d5919 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -547,7 +547,20 @@ void ThreadProxy::Stop() {
DCHECK(IsMainThread());
DCHECK(started_);
- // Synchronously deletes the impl.
+ // Synchronously finishes pending GL operations and deletes the impl.
+ // The two steps are done as separate post tasks, so that tasks posted
+ // by the GL implementation due to the Finish can be executed by the
+ // renderer before shutting it down.
+ {
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
+
+ CompletionEvent completion;
+ Proxy::ImplThread()->PostTask(
+ base::Bind(&ThreadProxy::FinishGLOnImplThread,
+ impl_thread_weak_ptr_,
+ &completion));
+ completion.Wait();
+ }
{
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
@@ -1157,6 +1170,14 @@ void ThreadProxy::InitializeRendererOnImplThread(
completion->Signal();
}
+void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) {
+ TRACE_EVENT0("cc", "ThreadProxy::FinishGLOnImplThread");
+ DCHECK(IsImplThread());
+ if (layer_tree_host_impl_->resource_provider())
+ layer_tree_host_impl_->resource_provider()->Finish();
+ completion->Signal();
+}
+
void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) {
TRACE_EVENT0("cc", "ThreadProxy::LayerTreeHostClosedOnImplThread");
DCHECK(IsImplThread());
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698