| 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/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/blimp/compositor_proto_state.h" | 10 #include "cc/blimp/compositor_proto_state.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 client_->DidReceiveCompositorFrameAck(); | 505 client_->DidReceiveCompositorFrameAck(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void LayerTreeHostRemote::SetTaskRunnerProviderForTesting( | 508 void LayerTreeHostRemote::SetTaskRunnerProviderForTesting( |
| 509 std::unique_ptr<TaskRunnerProvider> task_runner_provider) { | 509 std::unique_ptr<TaskRunnerProvider> task_runner_provider) { |
| 510 task_runner_provider_ = std::move(task_runner_provider); | 510 task_runner_provider_ = std::move(task_runner_provider); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void LayerTreeHostRemote::SerializeCurrentState( | 513 void LayerTreeHostRemote::SerializeCurrentState( |
| 514 proto::LayerTreeHost* layer_tree_host_proto) { | 514 proto::LayerTreeHost* layer_tree_host_proto) { |
| 515 // We need to serialize only the inputs received from the embedder. | |
| 516 const bool inputs_only = true; | |
| 517 | |
| 518 // Serialize the LayerTree. | 515 // Serialize the LayerTree. |
| 519 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree(), | 516 layer_tree_->ToProtobuf(layer_tree_host_proto->mutable_layer_tree()); |
| 520 inputs_only); | |
| 521 | 517 |
| 522 // Serialize the dirty layers. | 518 // Serialize the dirty layers. |
| 523 std::unordered_set<Layer*> layers_need_push_properties; | 519 std::unordered_set<Layer*> layers_need_push_properties; |
| 524 layers_need_push_properties.swap( | 520 layers_need_push_properties.swap( |
| 525 layer_tree_->LayersThatShouldPushProperties()); | 521 layer_tree_->LayersThatShouldPushProperties()); |
| 526 | 522 |
| 527 for (auto* layer : layers_need_push_properties) | 523 for (auto* layer : layers_need_push_properties) { |
| 528 layer->ToLayerPropertiesProto( | 524 proto::LayerProperties* layer_properties = |
| 529 layer_tree_host_proto->mutable_layer_updates(), inputs_only); | 525 layer_tree_host_proto->mutable_layer_updates()->add_layers(); |
| 526 layer->ToLayerPropertiesProto(layer_properties); |
| 527 } |
| 530 | 528 |
| 531 std::vector<PictureData> pictures = | 529 std::vector<PictureData> pictures = |
| 532 engine_picture_cache_->CalculateCacheUpdateAndFlush(); | 530 engine_picture_cache_->CalculateCacheUpdateAndFlush(); |
| 533 proto::PictureDataVectorToSkPicturesProto( | 531 proto::PictureDataVectorToSkPicturesProto( |
| 534 pictures, layer_tree_host_proto->mutable_pictures()); | 532 pictures, layer_tree_host_proto->mutable_pictures()); |
| 535 } | 533 } |
| 536 | 534 |
| 537 } // namespace cc | 535 } // namespace cc |
| OLD | NEW |