| 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/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 DebugScopedSetImplThread impl(this); | 607 DebugScopedSetImplThread impl(this); |
| 608 WillBeginImplFrame(begin_frame_args); | 608 WillBeginImplFrame(begin_frame_args); |
| 609 } | 609 } |
| 610 | 610 |
| 611 // Run the "main thread" and get it to commit. | 611 // Run the "main thread" and get it to commit. |
| 612 { | 612 { |
| 613 DCHECK(inside_impl_frame_); | 613 DCHECK(inside_impl_frame_); |
| 614 DoBeginMainFrame(begin_frame_args); | 614 DoBeginMainFrame(begin_frame_args); |
| 615 DoCommit(); | 615 DoCommit(); |
| 616 | 616 |
| 617 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) | 617 DCHECK_EQ(0u, layer_tree_host_->num_queued_promises()) |
| 618 << "Commit should always succeed and transfer promises."; | 618 << "Commit should always succeed and transfer promises."; |
| 619 } | 619 } |
| 620 | 620 |
| 621 // Finish the impl frame. | 621 // Finish the impl frame. |
| 622 { | 622 { |
| 623 DebugScopedSetImplThread impl(this); | 623 DebugScopedSetImplThread impl(this); |
| 624 if (layer_tree_host_impl_->settings().impl_side_painting) { | 624 if (layer_tree_host_impl_->settings().impl_side_painting) { |
| 625 layer_tree_host_impl_->ActivateSyncTree(); | 625 layer_tree_host_impl_->ActivateSyncTree(); |
| 626 DCHECK(!layer_tree_host_impl_->active_tree() | 626 DCHECK(!layer_tree_host_impl_->active_tree() |
| 627 ->needs_update_draw_properties()); | 627 ->needs_update_draw_properties()); |
| 628 layer_tree_host_impl_->PrepareTiles(); | 628 layer_tree_host_impl_->PrepareTiles(); |
| 629 layer_tree_host_impl_->SynchronouslyInitializeAllTiles(); | 629 layer_tree_host_impl_->SynchronouslyInitializeAllTiles(); |
| 630 } | 630 } |
| 631 | 631 |
| 632 DoAnimate(); | 632 DoAnimate(); |
| 633 | 633 |
| 634 LayerTreeHostImpl::FrameData frame; | 634 LayerTreeHostImpl::FrameData frame; |
| 635 DoComposite(&frame); | 635 DoComposite(&frame); |
| 636 | 636 |
| 637 // DoComposite could abort, but because this is a synchronous composite | 637 // DoComposite could abort, but because this is a synchronous composite |
| 638 // another draw will never be scheduled, so break remaining promises. | 638 // another draw will never be scheduled, so break remaining promises. |
| 639 layer_tree_host_impl_->active_tree()->BreakSwapPromises( | 639 layer_tree_host_impl_->active_tree()->BreakSwapPromises( |
| 640 SwapPromise::SWAP_FAILS); | 640 Promise::DidNotSwap::SWAP_FAILS); |
| 641 | 641 |
| 642 DidBeginImplFrameDeadline(); | 642 DidBeginImplFrameDeadline(); |
| 643 } | 643 } |
| 644 } | 644 } |
| 645 | 645 |
| 646 void SingleThreadProxy::ForceSerializeOnSwapBuffers() { | 646 void SingleThreadProxy::ForceSerializeOnSwapBuffers() { |
| 647 { | 647 { |
| 648 DebugScopedSetImplThread impl(this); | 648 DebugScopedSetImplThread impl(this); |
| 649 if (layer_tree_host_impl_->renderer()) { | 649 if (layer_tree_host_impl_->renderer()) { |
| 650 DCHECK(!layer_tree_host_->output_surface_lost()); | 650 DCHECK(!layer_tree_host_->output_surface_lost()); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 DCHECK(inside_impl_frame_) | 983 DCHECK(inside_impl_frame_) |
| 984 << "DidBeginImplFrameDeadline called while not inside an impl frame!"; | 984 << "DidBeginImplFrameDeadline called while not inside an impl frame!"; |
| 985 inside_impl_frame_ = false; | 985 inside_impl_frame_ = false; |
| 986 } | 986 } |
| 987 | 987 |
| 988 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 988 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 989 layer_tree_host_->SendBeginFramesToChildren(args); | 989 layer_tree_host_->SendBeginFramesToChildren(args); |
| 990 } | 990 } |
| 991 | 991 |
| 992 } // namespace cc | 992 } // namespace cc |
| OLD | NEW |