Chromium Code Reviews| Index: cc/trees/thread_proxy.cc |
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
| index 9fac98bb3490af63272a63cdcee171987260f85d..d7eb38ce0d44d83be17fbda3678841e6c18b3b57 100644 |
| --- a/cc/trees/thread_proxy.cc |
| +++ b/cc/trees/thread_proxy.cc |
| @@ -217,6 +217,18 @@ void ThreadProxy::SetOutputSurface(scoped_ptr<OutputSurface> output_surface) { |
| impl_thread_weak_ptr_, base::Passed(&output_surface))); |
| } |
| +scoped_ptr<OutputSurface> ThreadProxy::ReleaseOutputSurface() { |
| + DCHECK(IsMainThread()); |
| + |
| + DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| + CompletionEvent completion; |
| + Proxy::ImplThreadTaskRunner()->PostTask( |
| + FROM_HERE, base::Bind(&ThreadProxy::ReleaseOutputSurfaceOnImplThread, |
| + impl_thread_weak_ptr_, &completion)); |
| + completion.Wait(); |
| + return output_surface_.Pass(); |
|
no sievers
2015/09/10 17:27:45
You don't need this variable, but you can have a s
sohanjg
2015/09/11 07:00:50
Done.
|
| +} |
| + |
| void ThreadProxy::DidInitializeOutputSurface( |
| bool success, |
| const RendererCapabilities& capabilities) { |
| @@ -1082,6 +1094,16 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread( |
| impl().scheduler->DidCreateAndInitializeOutputSurface(); |
| } |
| +void ThreadProxy::ReleaseOutputSurfaceOnImplThread( |
| + CompletionEvent* completion) { |
| + TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread"); |
|
no sievers
2015/09/10 17:27:45
nit: "ThreadProxy::ReleaseOutputSurfaceOnImplThrea
sohanjg
2015/09/11 07:00:50
Done.
|
| + DCHECK(IsImplThread()); |
| + |
| + impl().scheduler->DidLoseOutputSurface(); |
| + output_surface_ = impl().layer_tree_host_impl->ReleaseOutputSurface(); |
| + completion->Signal(); |
| +} |
| + |
| void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) { |
| TRACE_EVENT0("cc", "ThreadProxy::FinishGLOnImplThread"); |
| DCHECK(IsImplThread()); |