Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 void SingleThreadProxy::RequestNewOutputSurface() { | 142 void SingleThreadProxy::RequestNewOutputSurface() { |
| 143 DCHECK(Proxy::IsMainThread()); | 143 DCHECK(Proxy::IsMainThread()); |
| 144 DCHECK(layer_tree_host_->output_surface_lost()); | 144 DCHECK(layer_tree_host_->output_surface_lost()); |
| 145 output_surface_creation_callback_.Cancel(); | 145 output_surface_creation_callback_.Cancel(); |
| 146 if (output_surface_creation_requested_) | 146 if (output_surface_creation_requested_) |
| 147 return; | 147 return; |
| 148 output_surface_creation_requested_ = true; | 148 output_surface_creation_requested_ = true; |
| 149 layer_tree_host_->RequestNewOutputSurface(); | 149 layer_tree_host_->RequestNewOutputSurface(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 scoped_ptr<OutputSurface> SingleThreadProxy::ReleaseOutputSurface() { | |
| 153 if (scheduler_on_impl_thread_) | |
| 154 scheduler_on_impl_thread_->DidLoseOutputSurface(); | |
|
danakj
2015/09/17 18:43:55
Can you DCHECK that LTH knows the OS is lost, and
| |
| 155 return layer_tree_host_impl_->ReleaseOutputSurface(); | |
| 156 } | |
| 157 | |
| 152 void SingleThreadProxy::SetOutputSurface( | 158 void SingleThreadProxy::SetOutputSurface( |
| 153 scoped_ptr<OutputSurface> output_surface) { | 159 scoped_ptr<OutputSurface> output_surface) { |
| 154 DCHECK(Proxy::IsMainThread()); | 160 DCHECK(Proxy::IsMainThread()); |
| 155 DCHECK(layer_tree_host_->output_surface_lost()); | 161 DCHECK(layer_tree_host_->output_surface_lost()); |
| 156 DCHECK(output_surface_creation_requested_); | 162 DCHECK(output_surface_creation_requested_); |
| 157 renderer_capabilities_for_main_thread_ = RendererCapabilities(); | 163 renderer_capabilities_for_main_thread_ = RendererCapabilities(); |
| 158 | 164 |
| 159 bool success; | 165 bool success; |
| 160 { | 166 { |
| 161 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 167 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 903 << "DidFinishImplFrame called while not inside an impl frame!"; | 909 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 904 inside_impl_frame_ = false; | 910 inside_impl_frame_ = false; |
| 905 #endif | 911 #endif |
| 906 } | 912 } |
| 907 | 913 |
| 908 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 914 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 909 layer_tree_host_->SendBeginFramesToChildren(args); | 915 layer_tree_host_->SendBeginFramesToChildren(args); |
| 910 } | 916 } |
| 911 | 917 |
| 912 } // namespace cc | 918 } // namespace cc |
| OLD | NEW |