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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 base::Bind(&ThreadProxy::SetRendererCapabilitiesMainThreadCopy, | 328 base::Bind(&ThreadProxy::SetRendererCapabilitiesMainThreadCopy, |
329 main_thread_weak_ptr_, | 329 main_thread_weak_ptr_, |
330 impl() | 330 impl() |
331 .layer_tree_host_impl->GetRendererCapabilities() | 331 .layer_tree_host_impl->GetRendererCapabilities() |
332 .MainThreadCapabilities())); | 332 .MainThreadCapabilities())); |
333 } | 333 } |
334 | 334 |
335 void ThreadProxy::DidLoseOutputSurfaceOnImplThread() { | 335 void ThreadProxy::DidLoseOutputSurfaceOnImplThread() { |
336 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread"); | 336 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread"); |
337 DCHECK(IsImplThread()); | 337 DCHECK(IsImplThread()); |
338 CheckOutputSurfaceStatusOnImplThread(); | |
339 } | |
340 | |
341 void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() { | |
342 TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread"); | |
343 DCHECK(IsImplThread()); | |
344 if (!impl().layer_tree_host_impl->IsContextLost()) | |
345 return; | |
346 Proxy::MainThreadTaskRunner()->PostTask( | 338 Proxy::MainThreadTaskRunner()->PostTask( |
347 FROM_HERE, | 339 FROM_HERE, |
348 base::Bind(&ThreadProxy::DidLoseOutputSurface, main_thread_weak_ptr_)); | 340 base::Bind(&ThreadProxy::DidLoseOutputSurface, main_thread_weak_ptr_)); |
349 impl().scheduler->DidLoseOutputSurface(); | 341 impl().scheduler->DidLoseOutputSurface(); |
350 } | 342 } |
351 | 343 |
352 void ThreadProxy::CommitVSyncParameters(base::TimeTicks timebase, | 344 void ThreadProxy::CommitVSyncParameters(base::TimeTicks timebase, |
353 base::TimeDelta interval) { | 345 base::TimeDelta interval) { |
354 impl().scheduler->CommitVSyncParameters(timebase, interval); | 346 impl().scheduler->CommitVSyncParameters(timebase, interval); |
355 } | 347 } |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 } | 1117 } |
1126 | 1118 |
1127 // Tell the main thread that the the newly-commited frame was drawn. | 1119 // Tell the main thread that the the newly-commited frame was drawn. |
1128 if (impl().next_frame_is_newly_committed_frame) { | 1120 if (impl().next_frame_is_newly_committed_frame) { |
1129 impl().next_frame_is_newly_committed_frame = false; | 1121 impl().next_frame_is_newly_committed_frame = false; |
1130 Proxy::MainThreadTaskRunner()->PostTask( | 1122 Proxy::MainThreadTaskRunner()->PostTask( |
1131 FROM_HERE, | 1123 FROM_HERE, |
1132 base::Bind(&ThreadProxy::DidCommitAndDrawFrame, main_thread_weak_ptr_)); | 1124 base::Bind(&ThreadProxy::DidCommitAndDrawFrame, main_thread_weak_ptr_)); |
1133 } | 1125 } |
1134 | 1126 |
1135 if (draw_frame) | |
1136 CheckOutputSurfaceStatusOnImplThread(); | |
1137 | |
1138 if (result == DRAW_SUCCESS) | 1127 if (result == DRAW_SUCCESS) |
1139 impl().timing_history.DidFinishDrawing(); | 1128 impl().timing_history.DidFinishDrawing(); |
1140 | 1129 |
1141 DCHECK_NE(INVALID_RESULT, result); | 1130 DCHECK_NE(INVALID_RESULT, result); |
1142 return result; | 1131 return result; |
1143 } | 1132 } |
1144 | 1133 |
1145 void ThreadProxy::ScheduledActionManageTiles() { | 1134 void ThreadProxy::ScheduledActionManageTiles() { |
1146 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); | 1135 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); |
1147 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1136 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 | 1402 |
1414 impl().timing_history.DidActivateSyncTree(); | 1403 impl().timing_history.DidActivateSyncTree(); |
1415 } | 1404 } |
1416 | 1405 |
1417 void ThreadProxy::DidManageTiles() { | 1406 void ThreadProxy::DidManageTiles() { |
1418 DCHECK(IsImplThread()); | 1407 DCHECK(IsImplThread()); |
1419 impl().scheduler->DidManageTiles(); | 1408 impl().scheduler->DidManageTiles(); |
1420 } | 1409 } |
1421 | 1410 |
1422 } // namespace cc | 1411 } // namespace cc |
OLD | NEW |