| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const LayerTreeSettings& settings = layer_tree_host->GetSettings(); | 70 const LayerTreeSettings& settings = layer_tree_host->GetSettings(); |
| 71 | 71 |
| 72 SchedulerSettings scheduler_settings(settings.ToSchedulerSettings()); | 72 SchedulerSettings scheduler_settings(settings.ToSchedulerSettings()); |
| 73 | 73 |
| 74 std::unique_ptr<CompositorTimingHistory> compositor_timing_history( | 74 std::unique_ptr<CompositorTimingHistory> compositor_timing_history( |
| 75 new CompositorTimingHistory( | 75 new CompositorTimingHistory( |
| 76 scheduler_settings.using_synchronous_renderer_compositor, | 76 scheduler_settings.using_synchronous_renderer_compositor, |
| 77 CompositorTimingHistory::RENDERER_UMA, | 77 CompositorTimingHistory::RENDERER_UMA, |
| 78 rendering_stats_instrumentation_)); | 78 rendering_stats_instrumentation_)); |
| 79 | 79 |
| 80 // BFS must either be external or come from the output surface. If | 80 // TODO(enne): remove these settings. |
| 81 // external, it must be provided. If from the output surface, it must | 81 DCHECK(!settings.use_external_begin_frame_source); |
| 82 // not be provided. | 82 DCHECK(settings.use_output_surface_begin_frame_source); |
| 83 // TODO(enne): Make all BFS come from the output surface. | |
| 84 DCHECK(settings.use_external_begin_frame_source ^ | |
| 85 settings.use_output_surface_begin_frame_source); | |
| 86 DCHECK(!settings.use_external_begin_frame_source || | |
| 87 external_begin_frame_source_); | |
| 88 DCHECK(!settings.use_output_surface_begin_frame_source || | |
| 89 !external_begin_frame_source_); | |
| 90 scheduler_ = Scheduler::Create(this, scheduler_settings, layer_tree_host_id_, | 83 scheduler_ = Scheduler::Create(this, scheduler_settings, layer_tree_host_id_, |
| 91 task_runner_provider_->ImplThreadTaskRunner(), | 84 task_runner_provider_->ImplThreadTaskRunner(), |
| 92 external_begin_frame_source_.get(), | 85 external_begin_frame_source_.get(), |
| 93 std::move(compositor_timing_history)); | 86 std::move(compositor_timing_history)); |
| 94 | 87 |
| 95 DCHECK_EQ(scheduler_->visible(), layer_tree_host_impl_->visible()); | 88 DCHECK_EQ(scheduler_->visible(), layer_tree_host_impl_->visible()); |
| 96 } | 89 } |
| 97 | 90 |
| 98 ProxyImpl::BlockedMainCommitOnly::BlockedMainCommitOnly() | 91 ProxyImpl::BlockedMainCommitOnly::BlockedMainCommitOnly() |
| 99 : layer_tree_host(nullptr) {} | 92 : layer_tree_host(nullptr) {} |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 bool ProxyImpl::IsMainThreadBlocked() const { | 622 bool ProxyImpl::IsMainThreadBlocked() const { |
| 630 return task_runner_provider_->IsMainThreadBlocked(); | 623 return task_runner_provider_->IsMainThreadBlocked(); |
| 631 } | 624 } |
| 632 | 625 |
| 633 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 626 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
| 634 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 627 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
| 635 return main_thread_blocked_commit_vars_unsafe_; | 628 return main_thread_blocked_commit_vars_unsafe_; |
| 636 } | 629 } |
| 637 | 630 |
| 638 } // namespace cc | 631 } // namespace cc |
| OLD | NEW |