OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blimp/layer_tree_host_remote.h" | 5 #include "cc/blimp/layer_tree_host_remote.h" |
6 | 6 |
7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/blimp/compositor_proto_state.h" | 10 #include "cc/blimp/compositor_proto_state.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 client_->DidCommit(); | 418 client_->DidCommit(); |
419 client_->DidBeginMainFrame(); | 419 client_->DidBeginMainFrame(); |
420 } | 420 } |
421 | 421 |
422 void LayerTreeHostRemote::DispatchDrawAndSwapCallbacks() { | 422 void LayerTreeHostRemote::DispatchDrawAndSwapCallbacks() { |
423 client_->DidCommitAndDrawFrame(); | 423 client_->DidCommitAndDrawFrame(); |
424 client_->DidCompleteSwapBuffers(); | 424 client_->DidCompleteSwapBuffers(); |
425 } | 425 } |
426 | 426 |
| 427 void LayerTreeHostRemote::SetTaskRunnerProviderForTesting( |
| 428 std::unique_ptr<TaskRunnerProvider> task_runner_provider) { |
| 429 task_runner_provider_ = std::move(task_runner_provider); |
| 430 } |
| 431 |
427 void LayerTreeHostRemote::SerializeCurrentState( | 432 void LayerTreeHostRemote::SerializeCurrentState( |
428 proto::LayerTreeHost* layer_tree_host_proto) { | 433 proto::LayerTreeHost* layer_tree_host_proto) { |
429 // We need to serialize only the inputs received from the embedder. | 434 // We need to serialize only the inputs received from the embedder. |
430 const bool inputs_only = true; | 435 const bool inputs_only = true; |
431 | 436 |
432 // Serialize the LayerTree. | 437 // Serialize the LayerTree. |
433 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), | 438 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), |
434 inputs_only); | 439 inputs_only); |
435 | 440 |
436 // Serialize the dirty layers. | 441 // Serialize the dirty layers. |
437 for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) | 442 for (auto* layer : layer_tree_->LayersThatShouldPushProperties()) |
438 layer->ToLayerPropertiesProto( | 443 layer->ToLayerPropertiesProto( |
439 layer_tree_host_proto->mutable_layer_updates(), inputs_only); | 444 layer_tree_host_proto->mutable_layer_updates(), inputs_only); |
440 layer_tree_->LayersThatShouldPushProperties().clear(); | 445 layer_tree_->LayersThatShouldPushProperties().clear(); |
441 | 446 |
442 // TODO(khushalsagar): Deal with picture caching. | 447 // TODO(khushalsagar): Deal with picture caching. |
443 } | 448 } |
444 | 449 |
445 } // namespace cc | 450 } // namespace cc |
OLD | NEW |