| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <stack> | 12 #include <stack> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <unordered_map> | 14 #include <unordered_map> |
| 15 | 15 |
| 16 #include "base/atomic_sequence_num.h" | |
| 17 #include "base/bind.h" | 16 #include "base/bind.h" |
| 18 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 19 #include "base/location.h" | 18 #include "base/location.h" |
| 20 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 21 #include "base/metrics/histogram_macros.h" | 20 #include "base/metrics/histogram_macros.h" |
| 22 #include "base/numerics/safe_math.h" | 21 #include "base/numerics/safe_math.h" |
| 23 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
| 24 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
| 25 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
| 26 #include "base/threading/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 #include "cc/trees/layer_tree_impl.h" | 56 #include "cc/trees/layer_tree_impl.h" |
| 58 #include "cc/trees/property_tree_builder.h" | 57 #include "cc/trees/property_tree_builder.h" |
| 59 #include "cc/trees/proxy_main.h" | 58 #include "cc/trees/proxy_main.h" |
| 60 #include "cc/trees/remote_channel_impl.h" | 59 #include "cc/trees/remote_channel_impl.h" |
| 61 #include "cc/trees/single_thread_proxy.h" | 60 #include "cc/trees/single_thread_proxy.h" |
| 62 #include "cc/trees/swap_promise_manager.h" | 61 #include "cc/trees/swap_promise_manager.h" |
| 63 #include "cc/trees/tree_synchronizer.h" | 62 #include "cc/trees/tree_synchronizer.h" |
| 64 #include "ui/gfx/geometry/size_conversions.h" | 63 #include "ui/gfx/geometry/size_conversions.h" |
| 65 #include "ui/gfx/geometry/vector2d_conversions.h" | 64 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 66 | 65 |
| 67 namespace { | |
| 68 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; | |
| 69 } | |
| 70 | |
| 71 namespace cc { | 66 namespace cc { |
| 72 namespace { | 67 namespace { |
| 73 | 68 |
| 74 std::unique_ptr<base::trace_event::TracedValue> | 69 std::unique_ptr<base::trace_event::TracedValue> |
| 75 ComputeLayerTreeHostProtoSizeSplitAsValue(proto::LayerTreeHost* proto) { | 70 ComputeLayerTreeHostProtoSizeSplitAsValue(proto::LayerTreeHost* proto) { |
| 76 std::unique_ptr<base::trace_event::TracedValue> value( | 71 std::unique_ptr<base::trace_event::TracedValue> value( |
| 77 new base::trace_event::TracedValue()); | 72 new base::trace_event::TracedValue()); |
| 78 base::CheckedNumeric<int> base_layer_properties_size = 0; | 73 base::CheckedNumeric<int> base_layer_properties_size = 0; |
| 79 base::CheckedNumeric<int> picture_layer_properties_size = 0; | 74 base::CheckedNumeric<int> picture_layer_properties_size = 0; |
| 80 base::CheckedNumeric<int> display_item_list_size = 0; | 75 base::CheckedNumeric<int> display_item_list_size = 0; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 client_(params->client), | 214 client_(params->client), |
| 220 source_frame_number_(0), | 215 source_frame_number_(0), |
| 221 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), | 216 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), |
| 222 settings_(*params->settings), | 217 settings_(*params->settings), |
| 223 debug_state_(settings_.initial_debug_state), | 218 debug_state_(settings_.initial_debug_state), |
| 224 visible_(false), | 219 visible_(false), |
| 225 has_gpu_rasterization_trigger_(false), | 220 has_gpu_rasterization_trigger_(false), |
| 226 content_is_suitable_for_gpu_rasterization_(true), | 221 content_is_suitable_for_gpu_rasterization_(true), |
| 227 gpu_rasterization_histogram_recorded_(false), | 222 gpu_rasterization_histogram_recorded_(false), |
| 228 did_complete_scale_animation_(false), | 223 did_complete_scale_animation_(false), |
| 229 id_(s_layer_tree_host_sequence_number.GetNext() + 1), | 224 id_(LayerTreeHost::GenerateHostId()), |
| 230 next_commit_forces_redraw_(false), | 225 next_commit_forces_redraw_(false), |
| 231 shared_bitmap_manager_(params->shared_bitmap_manager), | 226 shared_bitmap_manager_(params->shared_bitmap_manager), |
| 232 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), | 227 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), |
| 233 task_graph_runner_(params->task_graph_runner), | 228 task_graph_runner_(params->task_graph_runner), |
| 234 image_serialization_processor_(params->image_serialization_processor) { | 229 image_serialization_processor_(params->image_serialization_processor) { |
| 235 DCHECK(task_graph_runner_); | 230 DCHECK(task_graph_runner_); |
| 236 DCHECK(layer_tree_); | 231 DCHECK(layer_tree_); |
| 237 | 232 |
| 238 rendering_stats_instrumentation_->set_record_rendering_stats( | 233 rendering_stats_instrumentation_->set_record_rendering_stats( |
| 239 debug_state_.RecordRenderingStats()); | 234 debug_state_.RecordRenderingStats()); |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 | 1045 |
| 1051 debug_state_.FromProtobuf(proto.debug_state()); | 1046 debug_state_.FromProtobuf(proto.debug_state()); |
| 1052 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); | 1047 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); |
| 1053 content_is_suitable_for_gpu_rasterization_ = | 1048 content_is_suitable_for_gpu_rasterization_ = |
| 1054 proto.content_is_suitable_for_gpu_rasterization(); | 1049 proto.content_is_suitable_for_gpu_rasterization(); |
| 1055 id_ = proto.id(); | 1050 id_ = proto.id(); |
| 1056 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); | 1051 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); |
| 1057 } | 1052 } |
| 1058 | 1053 |
| 1059 } // namespace cc | 1054 } // namespace cc |
| OLD | NEW |