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

Unified Diff: cc/trees/thread_proxy.cc

Issue 1287043002: cc: Setup API to release OutputSurface from LTHClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test. Created 5 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
« cc/trees/single_thread_proxy.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | 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 9fac98bb3490af63272a63cdcee171987260f85d..fdc19de2fe91e624e3d8abd1aab67485b9a671d0 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -217,6 +217,19 @@ void ThreadProxy::SetOutputSurface(scoped_ptr<OutputSurface> output_surface) {
impl_thread_weak_ptr_, base::Passed(&output_surface)));
}
+scoped_ptr<OutputSurface> ThreadProxy::ReleaseOutputSurface() {
danakj 2015/09/17 18:43:55 Can you DCHECK that LTH knows the OS is lost?
+ DCHECK(IsMainThread());
+ DebugScopedSetMainThreadBlocked main_thread_blocked(this);
+ CompletionEvent completion;
+ scoped_ptr<OutputSurface> output_surface;
+ Proxy::ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::ReleaseOutputSurfaceOnImplThread,
+ impl_thread_weak_ptr_, &completion, &output_surface));
+ completion.Wait();
+ return output_surface.Pass();
danakj 2015/09/17 18:43:55 don't need Pass() on return
+}
+
void ThreadProxy::DidInitializeOutputSurface(
bool success,
const RendererCapabilities& capabilities) {
@@ -1082,6 +1095,17 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread(
impl().scheduler->DidCreateAndInitializeOutputSurface();
}
+void ThreadProxy::ReleaseOutputSurfaceOnImplThread(
+ CompletionEvent* completion,
+ scoped_ptr<OutputSurface>* output_surface) {
+ TRACE_EVENT0("cc", "ThreadProxy::ReleaseOutputSurfaceOnImplThread");
danakj 2015/09/17 18:43:55 we didn't trace in the STP, i think i'd rather the
+ DCHECK(IsImplThread());
+
+ impl().scheduler->DidLoseOutputSurface();
danakj 2015/09/17 18:43:55 Can you comment saying that, unlike in DidLoseOutp
+ *output_surface = impl().layer_tree_host_impl->ReleaseOutputSurface();
+ completion->Signal();
+}
+
void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) {
TRACE_EVENT0("cc", "ThreadProxy::FinishGLOnImplThread");
DCHECK(IsImplThread());
« cc/trees/single_thread_proxy.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698