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