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/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 | 182 |
183 void ThreadProxy::SetVisibleOnImplThread(CompletionEvent* completion, | 183 void ThreadProxy::SetVisibleOnImplThread(CompletionEvent* completion, |
184 bool visible) { | 184 bool visible) { |
185 TRACE_EVENT1("cc", "ThreadProxy::SetVisibleOnImplThread", "visible", visible); | 185 TRACE_EVENT1("cc", "ThreadProxy::SetVisibleOnImplThread", "visible", visible); |
186 impl().layer_tree_host_impl->SetVisible(visible); | 186 impl().layer_tree_host_impl->SetVisible(visible); |
187 impl().scheduler->SetVisible(visible); | 187 impl().scheduler->SetVisible(visible); |
188 completion->Signal(); | 188 completion->Signal(); |
189 } | 189 } |
190 | 190 |
| 191 void ThreadProxy::SetThrottleFrameProduction(bool throttle) { |
| 192 TRACE_EVENT1("cc", "ThreadProxy::SetThrottleFrameProduction", "throttle", |
| 193 throttle); |
| 194 Proxy::ImplThreadTaskRunner()->PostTask( |
| 195 FROM_HERE, |
| 196 base::Bind(&ThreadProxy::SetThrottleFrameProductionOnImplThread, |
| 197 impl_thread_weak_ptr_, throttle)); |
| 198 } |
| 199 |
| 200 void ThreadProxy::SetThrottleFrameProductionOnImplThread(bool throttle) { |
| 201 TRACE_EVENT1("cc", "ThreadProxy::SetThrottleFrameProductionOnImplThread", |
| 202 "throttle", throttle); |
| 203 impl().scheduler->SetThrottleFrameProduction(throttle); |
| 204 } |
| 205 |
191 void ThreadProxy::DidLoseOutputSurface() { | 206 void ThreadProxy::DidLoseOutputSurface() { |
192 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface"); | 207 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface"); |
193 DCHECK(IsMainThread()); | 208 DCHECK(IsMainThread()); |
194 layer_tree_host()->DidLoseOutputSurface(); | 209 layer_tree_host()->DidLoseOutputSurface(); |
195 | 210 |
196 { | 211 { |
197 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 212 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
198 | 213 |
199 // Return lost resources to their owners immediately. | 214 // Return lost resources to their owners immediately. |
200 BlockingTaskRunner::CapturePostTasks blocked( | 215 BlockingTaskRunner::CapturePostTasks blocked( |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 | 1347 |
1333 impl().timing_history.DidActivateSyncTree(); | 1348 impl().timing_history.DidActivateSyncTree(); |
1334 } | 1349 } |
1335 | 1350 |
1336 void ThreadProxy::DidPrepareTiles() { | 1351 void ThreadProxy::DidPrepareTiles() { |
1337 DCHECK(IsImplThread()); | 1352 DCHECK(IsImplThread()); |
1338 impl().scheduler->DidPrepareTiles(); | 1353 impl().scheduler->DidPrepareTiles(); |
1339 } | 1354 } |
1340 | 1355 |
1341 } // namespace cc | 1356 } // namespace cc |
OLD | NEW |