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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread"); | 428 TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread"); |
429 DCHECK(IsImplThread()); | 429 DCHECK(IsImplThread()); |
430 if (!impl().layer_tree_host_impl->IsContextLost()) | 430 if (!impl().layer_tree_host_impl->IsContextLost()) |
431 return; | 431 return; |
432 if (ContextProvider* offscreen_contexts = | 432 if (ContextProvider* offscreen_contexts = |
433 impl().layer_tree_host_impl->offscreen_context_provider()) | 433 impl().layer_tree_host_impl->offscreen_context_provider()) |
434 offscreen_contexts->VerifyContexts(); | 434 offscreen_contexts->VerifyContexts(); |
435 impl().scheduler->DidLoseOutputSurface(); | 435 impl().scheduler->DidLoseOutputSurface(); |
436 } | 436 } |
437 | 437 |
| 438 void ThreadProxy::SetMaxSwapsPending(int max) { |
| 439 impl().scheduler->SetMaxSwapsPending(max); |
| 440 } |
| 441 |
| 442 void ThreadProxy::DidSwapBuffersOnImplThread() { |
| 443 impl().scheduler->DidSwapBuffers(); |
| 444 } |
| 445 |
438 void ThreadProxy::OnSwapBuffersCompleteOnImplThread() { | 446 void ThreadProxy::OnSwapBuffersCompleteOnImplThread() { |
439 TRACE_EVENT0("cc", "ThreadProxy::OnSwapBuffersCompleteOnImplThread"); | 447 TRACE_EVENT0("cc", "ThreadProxy::OnSwapBuffersCompleteOnImplThread"); |
440 DCHECK(IsImplThread()); | 448 DCHECK(IsImplThread()); |
| 449 impl().scheduler->OnSwapBuffersComplete(); |
441 Proxy::MainThreadTaskRunner()->PostTask( | 450 Proxy::MainThreadTaskRunner()->PostTask( |
442 FROM_HERE, | 451 FROM_HERE, |
443 base::Bind(&ThreadProxy::DidCompleteSwapBuffers, main_thread_weak_ptr_)); | 452 base::Bind(&ThreadProxy::DidCompleteSwapBuffers, main_thread_weak_ptr_)); |
444 } | 453 } |
445 | 454 |
446 void ThreadProxy::SetNeedsBeginImplFrame(bool enable) { | 455 void ThreadProxy::SetNeedsBeginImplFrame(bool enable) { |
447 TRACE_EVENT1("cc", "ThreadProxy::SetNeedsBeginImplFrame", "enable", enable); | 456 TRACE_EVENT1("cc", "ThreadProxy::SetNeedsBeginImplFrame", "enable", enable); |
448 DCHECK(IsImplThread()); | 457 DCHECK(IsImplThread()); |
449 impl().layer_tree_host_impl->SetNeedsBeginImplFrame(enable); | 458 impl().layer_tree_host_impl->SetNeedsBeginImplFrame(enable); |
450 UpdateBackgroundAnimateTicking(); | 459 UpdateBackgroundAnimateTicking(); |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 | 1741 |
1733 impl().timing_history.DidActivatePendingTree(); | 1742 impl().timing_history.DidActivatePendingTree(); |
1734 } | 1743 } |
1735 | 1744 |
1736 void ThreadProxy::DidManageTiles() { | 1745 void ThreadProxy::DidManageTiles() { |
1737 DCHECK(IsImplThread()); | 1746 DCHECK(IsImplThread()); |
1738 impl().scheduler->DidManageTiles(); | 1747 impl().scheduler->DidManageTiles(); |
1739 } | 1748 } |
1740 | 1749 |
1741 } // namespace cc | 1750 } // namespace cc |
OLD | NEW |