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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 } | 486 } |
487 | 487 |
488 // Run the "main thread" and get it to commit. | 488 // Run the "main thread" and get it to commit. |
489 { | 489 { |
490 #if DCHECK_IS_ON() | 490 #if DCHECK_IS_ON() |
491 DCHECK(inside_impl_frame_); | 491 DCHECK(inside_impl_frame_); |
492 #endif | 492 #endif |
493 DoBeginMainFrame(begin_frame_args); | 493 DoBeginMainFrame(begin_frame_args); |
494 DoCommit(); | 494 DoCommit(); |
495 | 495 |
496 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) | 496 DCHECK_EQ( |
| 497 0u, |
| 498 layer_tree_host_->GetSwapPromiseManager()->num_queued_swap_promises()) |
497 << "Commit should always succeed and transfer promises."; | 499 << "Commit should always succeed and transfer promises."; |
498 } | 500 } |
499 | 501 |
500 // Finish the impl frame. | 502 // Finish the impl frame. |
501 { | 503 { |
502 DebugScopedSetImplThread impl(task_runner_provider_); | 504 DebugScopedSetImplThread impl(task_runner_provider_); |
503 layer_tree_host_impl_->ActivateSyncTree(); | 505 layer_tree_host_impl_->ActivateSyncTree(); |
504 DCHECK( | 506 DCHECK( |
505 !layer_tree_host_impl_->active_tree()->needs_update_draw_properties()); | 507 !layer_tree_host_impl_->active_tree()->needs_update_draw_properties()); |
506 layer_tree_host_impl_->PrepareTiles(); | 508 layer_tree_host_impl_->PrepareTiles(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 if (defer_commits_) { | 650 if (defer_commits_) { |
649 TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit", | 651 TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit", |
650 TRACE_EVENT_SCOPE_THREAD); | 652 TRACE_EVENT_SCOPE_THREAD); |
651 BeginMainFrameAbortedOnImplThread( | 653 BeginMainFrameAbortedOnImplThread( |
652 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT); | 654 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT); |
653 return; | 655 return; |
654 } | 656 } |
655 | 657 |
656 // This checker assumes NotifyReadyToCommit in this stack causes a synchronous | 658 // This checker assumes NotifyReadyToCommit in this stack causes a synchronous |
657 // commit. | 659 // commit. |
658 ScopedAbortRemainingSwapPromises swap_promise_checker(layer_tree_host_); | 660 ScopedAbortRemainingSwapPromises swap_promise_checker( |
| 661 layer_tree_host_->GetSwapPromiseManager()); |
659 | 662 |
660 if (!layer_tree_host_->IsVisible()) { | 663 if (!layer_tree_host_->IsVisible()) { |
661 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); | 664 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); |
662 BeginMainFrameAbortedOnImplThread( | 665 BeginMainFrameAbortedOnImplThread( |
663 CommitEarlyOutReason::ABORTED_NOT_VISIBLE); | 666 CommitEarlyOutReason::ABORTED_NOT_VISIBLE); |
664 return; | 667 return; |
665 } | 668 } |
666 | 669 |
667 // Prevent new commits from being requested inside DoBeginMainFrame. | 670 // Prevent new commits from being requested inside DoBeginMainFrame. |
668 // Note: We do not want to prevent SetNeedsAnimate from requesting | 671 // Note: We do not want to prevent SetNeedsAnimate from requesting |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 void SingleThreadProxy::DidFinishImplFrame() { | 768 void SingleThreadProxy::DidFinishImplFrame() { |
766 layer_tree_host_impl_->DidFinishImplFrame(); | 769 layer_tree_host_impl_->DidFinishImplFrame(); |
767 #if DCHECK_IS_ON() | 770 #if DCHECK_IS_ON() |
768 DCHECK(inside_impl_frame_) | 771 DCHECK(inside_impl_frame_) |
769 << "DidFinishImplFrame called while not inside an impl frame!"; | 772 << "DidFinishImplFrame called while not inside an impl frame!"; |
770 inside_impl_frame_ = false; | 773 inside_impl_frame_ = false; |
771 #endif | 774 #endif |
772 } | 775 } |
773 | 776 |
774 } // namespace cc | 777 } // namespace cc |
OLD | NEW |