| 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/layer_tree_host_in_process.h" | 5 #include "cc/trees/layer_tree_host_in_process.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), | 115 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), |
| 116 settings_(*params->settings), | 116 settings_(*params->settings), |
| 117 debug_state_(settings_.initial_debug_state), | 117 debug_state_(settings_.initial_debug_state), |
| 118 visible_(false), | 118 visible_(false), |
| 119 has_gpu_rasterization_trigger_(false), | 119 has_gpu_rasterization_trigger_(false), |
| 120 content_is_suitable_for_gpu_rasterization_(true), | 120 content_is_suitable_for_gpu_rasterization_(true), |
| 121 gpu_rasterization_histogram_recorded_(false), | 121 gpu_rasterization_histogram_recorded_(false), |
| 122 did_complete_scale_animation_(false), | 122 did_complete_scale_animation_(false), |
| 123 id_(s_layer_tree_host_sequence_number.GetNext() + 1), | 123 id_(s_layer_tree_host_sequence_number.GetNext() + 1), |
| 124 task_graph_runner_(params->task_graph_runner), | 124 task_graph_runner_(params->task_graph_runner), |
| 125 image_serialization_processor_(params->image_serialization_processor) { | 125 image_serialization_processor_(params->image_serialization_processor), |
| 126 image_worker_task_runner_(params->image_worker_task_runner) { |
| 126 DCHECK(task_graph_runner_); | 127 DCHECK(task_graph_runner_); |
| 127 DCHECK(layer_tree_); | 128 DCHECK(layer_tree_); |
| 128 DCHECK_NE(compositor_mode_, CompositorMode::REMOTE); | 129 DCHECK_NE(compositor_mode_, CompositorMode::REMOTE); |
| 129 | 130 |
| 130 rendering_stats_instrumentation_->set_record_rendering_stats( | 131 rendering_stats_instrumentation_->set_record_rendering_stats( |
| 131 debug_state_.RecordRenderingStats()); | 132 debug_state_.RecordRenderingStats()); |
| 132 } | 133 } |
| 133 | 134 |
| 134 void LayerTreeHostInProcess::InitializeThreaded( | 135 void LayerTreeHostInProcess::InitializeThreaded( |
| 135 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 136 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 LayerTreeHostImplClient* client) { | 439 LayerTreeHostImplClient* client) { |
| 439 DCHECK(task_runner_provider_->IsImplThread()); | 440 DCHECK(task_runner_provider_->IsImplThread()); |
| 440 | 441 |
| 441 const bool supports_impl_scrolling = task_runner_provider_->HasImplThread(); | 442 const bool supports_impl_scrolling = task_runner_provider_->HasImplThread(); |
| 442 std::unique_ptr<MutatorHost> mutator_host_impl = | 443 std::unique_ptr<MutatorHost> mutator_host_impl = |
| 443 layer_tree_->mutator_host()->CreateImplInstance(supports_impl_scrolling); | 444 layer_tree_->mutator_host()->CreateImplInstance(supports_impl_scrolling); |
| 444 | 445 |
| 445 std::unique_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( | 446 std::unique_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( |
| 446 settings_, client, task_runner_provider_.get(), | 447 settings_, client, task_runner_provider_.get(), |
| 447 rendering_stats_instrumentation_.get(), task_graph_runner_, | 448 rendering_stats_instrumentation_.get(), task_graph_runner_, |
| 448 std::move(mutator_host_impl), id_); | 449 std::move(mutator_host_impl), id_, std::move(image_worker_task_runner_)); |
| 449 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); | 450 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); |
| 450 host_impl->SetContentIsSuitableForGpuRasterization( | 451 host_impl->SetContentIsSuitableForGpuRasterization( |
| 451 content_is_suitable_for_gpu_rasterization_); | 452 content_is_suitable_for_gpu_rasterization_); |
| 452 task_graph_runner_ = NULL; | 453 task_graph_runner_ = NULL; |
| 453 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | 454 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
| 454 return host_impl; | 455 return host_impl; |
| 455 } | 456 } |
| 456 | 457 |
| 457 void LayerTreeHostInProcess::DidLoseCompositorFrameSink() { | 458 void LayerTreeHostInProcess::DidLoseCompositorFrameSink() { |
| 458 TRACE_EVENT0("cc", "LayerTreeHostInProcess::DidLoseCompositorFrameSink"); | 459 TRACE_EVENT0("cc", "LayerTreeHostInProcess::DidLoseCompositorFrameSink"); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 return compositor_mode_ == CompositorMode::SINGLE_THREADED; | 853 return compositor_mode_ == CompositorMode::SINGLE_THREADED; |
| 853 } | 854 } |
| 854 | 855 |
| 855 bool LayerTreeHostInProcess::IsThreaded() const { | 856 bool LayerTreeHostInProcess::IsThreaded() const { |
| 856 DCHECK(compositor_mode_ != CompositorMode::THREADED || | 857 DCHECK(compositor_mode_ != CompositorMode::THREADED || |
| 857 task_runner_provider_->HasImplThread()); | 858 task_runner_provider_->HasImplThread()); |
| 858 return compositor_mode_ == CompositorMode::THREADED; | 859 return compositor_mode_ == CompositorMode::THREADED; |
| 859 } | 860 } |
| 860 | 861 |
| 861 } // namespace cc | 862 } // namespace cc |
| OLD | NEW |