| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/proxy_impl.h" | 5 #include "cc/trees/proxy_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 std::unique_ptr<CompositorTimingHistory> compositor_timing_history( | 80 std::unique_ptr<CompositorTimingHistory> compositor_timing_history( |
| 81 new CompositorTimingHistory( | 81 new CompositorTimingHistory( |
| 82 scheduler_settings.using_synchronous_renderer_compositor, | 82 scheduler_settings.using_synchronous_renderer_compositor, |
| 83 CompositorTimingHistory::RENDERER_UMA, | 83 CompositorTimingHistory::RENDERER_UMA, |
| 84 rendering_stats_instrumentation_)); | 84 rendering_stats_instrumentation_)); |
| 85 | 85 |
| 86 BeginFrameSource* frame_source = external_begin_frame_source_.get(); | 86 BeginFrameSource* frame_source = external_begin_frame_source_.get(); |
| 87 if (!scheduler_settings.throttle_frame_production) { | 87 if (!scheduler_settings.throttle_frame_production) { |
| 88 // Unthrottled source takes precedence over external sources. | 88 // Unthrottled source takes precedence over external sources. |
| 89 unthrottled_begin_frame_source_.reset( | 89 unthrottled_begin_frame_source_.reset(new BackToBackBeginFrameSource( |
| 90 new BackToBackBeginFrameSource(base::MakeUnique<DelayBasedTimeSource>( | 90 task_runner_provider_->ImplThreadTaskRunner())); |
| 91 task_runner_provider_->ImplThreadTaskRunner()))); | |
| 92 frame_source = unthrottled_begin_frame_source_.get(); | 91 frame_source = unthrottled_begin_frame_source_.get(); |
| 93 } | 92 } |
| 94 if (!frame_source) { | 93 if (!frame_source) { |
| 95 synthetic_begin_frame_source_.reset( | 94 synthetic_begin_frame_source_.reset(new DelayBasedBeginFrameSource( |
| 96 new DelayBasedBeginFrameSource(base::MakeUnique<DelayBasedTimeSource>( | 95 task_runner_provider_->ImplThreadTaskRunner())); |
| 97 task_runner_provider_->ImplThreadTaskRunner()))); | |
| 98 frame_source = synthetic_begin_frame_source_.get(); | 96 frame_source = synthetic_begin_frame_source_.get(); |
| 99 } | 97 } |
| 100 scheduler_ = | 98 scheduler_ = |
| 101 Scheduler::Create(this, scheduler_settings, layer_tree_host_id_, | 99 Scheduler::Create(this, scheduler_settings, layer_tree_host_id_, |
| 102 task_runner_provider_->ImplThreadTaskRunner(), | 100 task_runner_provider_->ImplThreadTaskRunner(), |
| 103 frame_source, std::move(compositor_timing_history)); | 101 frame_source, std::move(compositor_timing_history)); |
| 104 | 102 |
| 105 DCHECK_EQ(scheduler_->visible(), layer_tree_host_impl_->visible()); | 103 DCHECK_EQ(scheduler_->visible(), layer_tree_host_impl_->visible()); |
| 106 } | 104 } |
| 107 | 105 |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 bool ProxyImpl::IsMainThreadBlocked() const { | 678 bool ProxyImpl::IsMainThreadBlocked() const { |
| 681 return task_runner_provider_->IsMainThreadBlocked(); | 679 return task_runner_provider_->IsMainThreadBlocked(); |
| 682 } | 680 } |
| 683 | 681 |
| 684 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 682 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
| 685 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 683 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
| 686 return main_thread_blocked_commit_vars_unsafe_; | 684 return main_thread_blocked_commit_vars_unsafe_; |
| 687 } | 685 } |
| 688 | 686 |
| 689 } // namespace cc | 687 } // namespace cc |
| OLD | NEW |