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