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

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: 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
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 3b051f7d537121c97966616a654e507994355aa8..7665a38ab56ce3c39bdb62ba6a855290d8bbf099 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -546,12 +546,21 @@ void ThreadProxy::Stop() {
DCHECK(IsMainThread());
DCHECK(started_);
- // Synchronously deletes the impl.
+ // Synchronously finishes pending GL operations and deletes the impl.
{
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);
+
+ CompletionEvent completion;
+ Proxy::ImplThread()->PostTask(
base::Bind(&ThreadProxy::LayerTreeHostClosedOnImplThread,
impl_thread_weak_ptr_,
&completion));
@@ -1153,6 +1162,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());

Powered by Google App Engine
This is Rietveld 408576698