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/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
10 #include "cc/debug/devtools_instrumentation.h" | 10 #include "cc/debug/devtools_instrumentation.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 DoCommit(); | 525 DoCommit(); |
526 | 526 |
527 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) | 527 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) |
528 << "Commit should always succeed and transfer promises."; | 528 << "Commit should always succeed and transfer promises."; |
529 } | 529 } |
530 | 530 |
531 { | 531 { |
532 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); | 532 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); |
533 if (layer_tree_host_impl_->settings().impl_side_painting) { | 533 if (layer_tree_host_impl_->settings().impl_side_painting) { |
534 layer_tree_host_impl_->ActivateSyncTree(); | 534 layer_tree_host_impl_->ActivateSyncTree(); |
535 layer_tree_host_impl_->active_tree()->UpdateDrawProperties(); | 535 DCHECK(!layer_tree_host_impl_->active_tree() |
| 536 ->needs_update_draw_properties()); |
536 layer_tree_host_impl_->PrepareTiles(); | 537 layer_tree_host_impl_->PrepareTiles(); |
537 layer_tree_host_impl_->SynchronouslyInitializeAllTiles(); | 538 layer_tree_host_impl_->SynchronouslyInitializeAllTiles(); |
538 } | 539 } |
539 | 540 |
540 DoAnimate(); | 541 DoAnimate(); |
541 | 542 |
542 LayerTreeHostImpl::FrameData frame; | 543 LayerTreeHostImpl::FrameData frame; |
543 DoComposite(frame_begin_time, &frame); | 544 DoComposite(frame_begin_time, &frame); |
544 | 545 |
545 // DoComposite could abort, but because this is a synchronous composite | 546 // DoComposite could abort, but because this is a synchronous composite |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 // (i.e. property modifications) causing some to fall on one frame and some to | 679 // (i.e. property modifications) causing some to fall on one frame and some to |
679 // fall on the next. Doing it asynchronously instead matches the semantics of | 680 // fall on the next. Doing it asynchronously instead matches the semantics of |
680 // ThreadProxy::SetNeedsCommit where SetNeedsCommit will not cause a | 681 // ThreadProxy::SetNeedsCommit where SetNeedsCommit will not cause a |
681 // synchronous commit. | 682 // synchronous commit. |
682 MainThreadTaskRunner()->PostTask( | 683 MainThreadTaskRunner()->PostTask( |
683 FROM_HERE, | 684 FROM_HERE, |
684 base::Bind(&SingleThreadProxy::BeginMainFrame, | 685 base::Bind(&SingleThreadProxy::BeginMainFrame, |
685 weak_factory_.GetWeakPtr())); | 686 weak_factory_.GetWeakPtr())); |
686 } | 687 } |
687 | 688 |
| 689 void SingleThreadProxy::SendBeginMainFrameNotExpectedSoon() { |
| 690 layer_tree_host_->BeginMainFrameNotExpectedSoon(); |
| 691 } |
| 692 |
688 void SingleThreadProxy::BeginMainFrame() { | 693 void SingleThreadProxy::BeginMainFrame() { |
689 if (defer_commits_) { | 694 if (defer_commits_) { |
690 TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit", | 695 TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit", |
691 TRACE_EVENT_SCOPE_THREAD); | 696 TRACE_EVENT_SCOPE_THREAD); |
692 BeginMainFrameAbortedOnImplThread( | 697 BeginMainFrameAbortedOnImplThread( |
693 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT); | 698 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT); |
694 return; | 699 return; |
695 } | 700 } |
696 | 701 |
697 // This checker assumes NotifyReadyToCommit in this stack causes a synchronous | 702 // This checker assumes NotifyReadyToCommit in this stack causes a synchronous |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 831 |
827 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 832 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
828 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 833 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
829 } | 834 } |
830 | 835 |
831 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 836 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
832 layer_tree_host_->SendBeginFramesToChildren(args); | 837 layer_tree_host_->SendBeginFramesToChildren(args); |
833 } | 838 } |
834 | 839 |
835 } // namespace cc | 840 } // namespace cc |
OLD | NEW |