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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 if (compositor_frame_sink_lost_) { | 444 if (compositor_frame_sink_lost_) { |
445 RequestNewCompositorFrameSink(); | 445 RequestNewCompositorFrameSink(); |
446 // RequestNewCompositorFrameSink could have synchronously created an output | 446 // RequestNewCompositorFrameSink could have synchronously created an output |
447 // surface, so check again before returning. | 447 // surface, so check again before returning. |
448 if (compositor_frame_sink_lost_) | 448 if (compositor_frame_sink_lost_) |
449 return; | 449 return; |
450 } | 450 } |
451 | 451 |
452 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( | 452 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( |
453 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), | 453 BEGINFRAME_FROM_HERE, 0, 1, frame_begin_time, base::TimeTicks(), |
454 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL)); | 454 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL)); |
455 | 455 |
456 // Start the impl frame. | 456 // Start the impl frame. |
457 { | 457 { |
458 DebugScopedSetImplThread impl(task_runner_provider_); | 458 DebugScopedSetImplThread impl(task_runner_provider_); |
459 WillBeginImplFrame(begin_frame_args); | 459 WillBeginImplFrame(begin_frame_args); |
460 } | 460 } |
461 | 461 |
462 // Run the "main thread" and get it to commit. | 462 // Run the "main thread" and get it to commit. |
463 { | 463 { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 | 685 |
686 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; | 686 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; |
687 layer_tree_host_impl_->BeginMainFrameAborted(reason, | 687 layer_tree_host_impl_->BeginMainFrameAborted(reason, |
688 std::move(empty_swap_promises)); | 688 std::move(empty_swap_promises)); |
689 scheduler_on_impl_thread_->BeginMainFrameAborted(reason); | 689 scheduler_on_impl_thread_->BeginMainFrameAborted(reason); |
690 } | 690 } |
691 | 691 |
692 DrawResult SingleThreadProxy::ScheduledActionDrawIfPossible() { | 692 DrawResult SingleThreadProxy::ScheduledActionDrawIfPossible() { |
693 DebugScopedSetImplThread impl(task_runner_provider_); | 693 DebugScopedSetImplThread impl(task_runner_provider_); |
694 LayerTreeHostImpl::FrameData frame; | 694 LayerTreeHostImpl::FrameData frame; |
| 695 frame.begin_frame_source_id = |
| 696 scheduler_on_impl_thread_->CurrentBeginFrameSourceId(); |
| 697 frame.begin_frame_number = |
| 698 scheduler_on_impl_thread_->CurrentBeginFrameNumber(); |
| 699 frame.oldest_incorporated_frame = |
| 700 scheduler_on_impl_thread_->OldestIncorporatedFrameForActiveTree(); |
695 return DoComposite(&frame); | 701 return DoComposite(&frame); |
696 } | 702 } |
697 | 703 |
698 DrawResult SingleThreadProxy::ScheduledActionDrawForced() { | 704 DrawResult SingleThreadProxy::ScheduledActionDrawForced() { |
699 NOTREACHED(); | 705 NOTREACHED(); |
700 return INVALID_RESULT; | 706 return INVALID_RESULT; |
701 } | 707 } |
702 | 708 |
703 void SingleThreadProxy::ScheduledActionCommit() { | 709 void SingleThreadProxy::ScheduledActionCommit() { |
704 DebugScopedSetMainThread main(task_runner_provider_); | 710 DebugScopedSetMainThread main(task_runner_provider_); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 void SingleThreadProxy::DidFinishImplFrame() { | 750 void SingleThreadProxy::DidFinishImplFrame() { |
745 layer_tree_host_impl_->DidFinishImplFrame(); | 751 layer_tree_host_impl_->DidFinishImplFrame(); |
746 #if DCHECK_IS_ON() | 752 #if DCHECK_IS_ON() |
747 DCHECK(inside_impl_frame_) | 753 DCHECK(inside_impl_frame_) |
748 << "DidFinishImplFrame called while not inside an impl frame!"; | 754 << "DidFinishImplFrame called while not inside an impl frame!"; |
749 inside_impl_frame_ = false; | 755 inside_impl_frame_ = false; |
750 #endif | 756 #endif |
751 } | 757 } |
752 | 758 |
753 } // namespace cc | 759 } // namespace cc |
OLD | NEW |