| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 source_frame_number_(0), | 207 source_frame_number_(0), |
| 208 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), | 208 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), |
| 209 settings_(*params->settings), | 209 settings_(*params->settings), |
| 210 debug_state_(settings_.initial_debug_state), | 210 debug_state_(settings_.initial_debug_state), |
| 211 visible_(false), | 211 visible_(false), |
| 212 has_gpu_rasterization_trigger_(false), | 212 has_gpu_rasterization_trigger_(false), |
| 213 content_is_suitable_for_gpu_rasterization_(true), | 213 content_is_suitable_for_gpu_rasterization_(true), |
| 214 gpu_rasterization_histogram_recorded_(false), | 214 gpu_rasterization_histogram_recorded_(false), |
| 215 did_complete_scale_animation_(false), | 215 did_complete_scale_animation_(false), |
| 216 id_(s_layer_tree_host_sequence_number.GetNext() + 1), | 216 id_(s_layer_tree_host_sequence_number.GetNext() + 1), |
| 217 shared_bitmap_manager_(params->shared_bitmap_manager), | |
| 218 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), | |
| 219 task_graph_runner_(params->task_graph_runner), | 217 task_graph_runner_(params->task_graph_runner), |
| 220 image_serialization_processor_(params->image_serialization_processor) { | 218 image_serialization_processor_(params->image_serialization_processor) { |
| 221 DCHECK(task_graph_runner_); | 219 DCHECK(task_graph_runner_); |
| 222 DCHECK(layer_tree_); | 220 DCHECK(layer_tree_); |
| 223 | 221 |
| 224 rendering_stats_instrumentation_->set_record_rendering_stats( | 222 rendering_stats_instrumentation_->set_record_rendering_stats( |
| 225 debug_state_.RecordRenderingStats()); | 223 debug_state_.RecordRenderingStats()); |
| 226 } | 224 } |
| 227 | 225 |
| 228 void LayerTreeHostInProcess::InitializeThreaded( | 226 void LayerTreeHostInProcess::InitializeThreaded( |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 DCHECK(!IsRemoteServer()); | 553 DCHECK(!IsRemoteServer()); |
| 556 DCHECK(task_runner_provider_->IsImplThread()); | 554 DCHECK(task_runner_provider_->IsImplThread()); |
| 557 | 555 |
| 558 const bool supports_impl_scrolling = task_runner_provider_->HasImplThread(); | 556 const bool supports_impl_scrolling = task_runner_provider_->HasImplThread(); |
| 559 std::unique_ptr<AnimationHost> animation_host_impl = | 557 std::unique_ptr<AnimationHost> animation_host_impl = |
| 560 layer_tree_->animation_host()->CreateImplInstance( | 558 layer_tree_->animation_host()->CreateImplInstance( |
| 561 supports_impl_scrolling); | 559 supports_impl_scrolling); |
| 562 | 560 |
| 563 std::unique_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( | 561 std::unique_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( |
| 564 settings_, client, task_runner_provider_.get(), | 562 settings_, client, task_runner_provider_.get(), |
| 565 rendering_stats_instrumentation_.get(), shared_bitmap_manager_, | 563 rendering_stats_instrumentation_.get(), task_graph_runner_, |
| 566 gpu_memory_buffer_manager_, task_graph_runner_, | |
| 567 std::move(animation_host_impl), id_); | 564 std::move(animation_host_impl), id_); |
| 568 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); | 565 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); |
| 569 host_impl->SetContentIsSuitableForGpuRasterization( | 566 host_impl->SetContentIsSuitableForGpuRasterization( |
| 570 content_is_suitable_for_gpu_rasterization_); | 567 content_is_suitable_for_gpu_rasterization_); |
| 571 shared_bitmap_manager_ = NULL; | |
| 572 gpu_memory_buffer_manager_ = NULL; | |
| 573 task_graph_runner_ = NULL; | 568 task_graph_runner_ = NULL; |
| 574 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | 569 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
| 575 return host_impl; | 570 return host_impl; |
| 576 } | 571 } |
| 577 | 572 |
| 578 void LayerTreeHostInProcess::DidLoseCompositorFrameSink() { | 573 void LayerTreeHostInProcess::DidLoseCompositorFrameSink() { |
| 579 TRACE_EVENT0("cc", "LayerTreeHostInProcess::DidLoseCompositorFrameSink"); | 574 TRACE_EVENT0("cc", "LayerTreeHostInProcess::DidLoseCompositorFrameSink"); |
| 580 DCHECK(task_runner_provider_->IsMainThread()); | 575 DCHECK(task_runner_provider_->IsMainThread()); |
| 581 SetNeedsCommit(); | 576 SetNeedsCommit(); |
| 582 } | 577 } |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 | 1024 |
| 1030 debug_state_.FromProtobuf(proto.debug_state()); | 1025 debug_state_.FromProtobuf(proto.debug_state()); |
| 1031 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); | 1026 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); |
| 1032 content_is_suitable_for_gpu_rasterization_ = | 1027 content_is_suitable_for_gpu_rasterization_ = |
| 1033 proto.content_is_suitable_for_gpu_rasterization(); | 1028 proto.content_is_suitable_for_gpu_rasterization(); |
| 1034 id_ = proto.id(); | 1029 id_ = proto.id(); |
| 1035 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); | 1030 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); |
| 1036 } | 1031 } |
| 1037 | 1032 |
| 1038 } // namespace cc | 1033 } // namespace cc |
| OLD | NEW |