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.h" | 5 #include "cc/trees/layer_tree_host.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" | 16 #include "base/atomic_sequence_num.h" |
17 #include "base/auto_reset.h" | 17 #include "base/auto_reset.h" |
18 #include "base/bind.h" | 18 #include "base/bind.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/location.h" | 20 #include "base/location.h" |
| 21 #include "base/memory/ptr_util.h" |
21 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
22 #include "base/numerics/safe_math.h" | 23 #include "base/numerics/safe_math.h" |
23 #include "base/single_thread_task_runner.h" | 24 #include "base/single_thread_task_runner.h" |
24 #include "base/stl_util.h" | 25 #include "base/stl_util.h" |
25 #include "base/strings/string_number_conversions.h" | 26 #include "base/strings/string_number_conversions.h" |
26 #include "base/threading/thread_task_runner_handle.h" | 27 #include "base/threading/thread_task_runner_handle.h" |
27 #include "base/trace_event/trace_event.h" | 28 #include "base/trace_event/trace_event.h" |
28 #include "base/trace_event/trace_event_argument.h" | 29 #include "base/trace_event/trace_event_argument.h" |
29 #include "cc/animation/animation_events.h" | 30 #include "cc/animation/animation_events.h" |
30 #include "cc/animation/animation_host.h" | 31 #include "cc/animation/animation_host.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 client_picture_cache_ = | 316 client_picture_cache_ = |
316 image_serialization_processor_->CreateClientPictureCache(); | 317 image_serialization_processor_->CreateClientPictureCache(); |
317 } | 318 } |
318 | 319 |
319 // For the remote mode, the RemoteChannelImpl implements the Proxy, which is | 320 // For the remote mode, the RemoteChannelImpl implements the Proxy, which is |
320 // owned by the LayerTreeHost. The RemoteChannelImpl pipes requests which need | 321 // owned by the LayerTreeHost. The RemoteChannelImpl pipes requests which need |
321 // to handled locally, for instance the Output Surface creation to the | 322 // to handled locally, for instance the Output Surface creation to the |
322 // LayerTreeHost on the client, while the other requests are sent to the | 323 // LayerTreeHost on the client, while the other requests are sent to the |
323 // RemoteChannelMain on the server which directs them to ProxyMain and the | 324 // RemoteChannelMain on the server which directs them to ProxyMain and the |
324 // remote server LayerTreeHost. | 325 // remote server LayerTreeHost. |
325 InitializeProxy(RemoteChannelImpl::Create(this, remote_proto_channel, | 326 InitializeProxy(base::MakeUnique<RemoteChannelImpl>( |
326 task_runner_provider_.get()), | 327 this, remote_proto_channel, task_runner_provider_.get()), |
327 nullptr); | 328 nullptr); |
328 } | 329 } |
329 | 330 |
330 void LayerTreeHost::InitializeForTesting( | 331 void LayerTreeHost::InitializeForTesting( |
331 std::unique_ptr<TaskRunnerProvider> task_runner_provider, | 332 std::unique_ptr<TaskRunnerProvider> task_runner_provider, |
332 std::unique_ptr<Proxy> proxy_for_testing, | 333 std::unique_ptr<Proxy> proxy_for_testing, |
333 std::unique_ptr<BeginFrameSource> external_begin_frame_source) { | 334 std::unique_ptr<BeginFrameSource> external_begin_frame_source) { |
334 task_runner_provider_ = std::move(task_runner_provider); | 335 task_runner_provider_ = std::move(task_runner_provider); |
335 | 336 |
336 InitializePictureCacheForTesting(); | 337 InitializePictureCacheForTesting(); |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 int seq_num = property_trees_.sequence_number; | 1693 int seq_num = property_trees_.sequence_number; |
1693 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { | 1694 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { |
1694 layer->set_property_tree_sequence_number(seq_num); | 1695 layer->set_property_tree_sequence_number(seq_num); |
1695 }); | 1696 }); |
1696 | 1697 |
1697 surface_client_id_ = proto.surface_client_id(); | 1698 surface_client_id_ = proto.surface_client_id(); |
1698 next_surface_sequence_ = proto.next_surface_sequence(); | 1699 next_surface_sequence_ = proto.next_surface_sequence(); |
1699 } | 1700 } |
1700 | 1701 |
1701 } // namespace cc | 1702 } // namespace cc |
OLD | NEW |