OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/layers/heads_up_display_layer.h" | 7 #include "cc/layers/heads_up_display_layer.h" |
8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "cc/proto/layer.pb.h" | 9 #include "cc/proto/layer.pb.h" |
10 #include "cc/proto/layer_tree_host.pb.h" | 10 #include "cc/proto/layer_tree_host.pb.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 DCHECK(layer->layer_tree_host()); | 51 DCHECK(layer->layer_tree_host()); |
52 EXPECT_EQ(layer, layer->layer_tree_host()->LayerById(layer->id())); | 52 EXPECT_EQ(layer, layer->layer_tree_host()->LayerById(layer->id())); |
53 }); | 53 }); |
54 } | 54 } |
55 | 55 |
56 void VerifySerializationAndDeserialization() { | 56 void VerifySerializationAndDeserialization() { |
57 proto::LayerTreeHost proto; | 57 proto::LayerTreeHost proto; |
58 | 58 |
59 std::unordered_set<Layer*> layers_that_should_push_properties_src = | 59 std::unordered_set<Layer*> layers_that_should_push_properties_src = |
60 layer_tree_host_src_->LayersThatShouldPushProperties(); | 60 layer_tree_host_src_->LayersThatShouldPushProperties(); |
61 layer_tree_host_src_->ToProtobufForCommit(&proto); | 61 std::vector<std::unique_ptr<SwapPromise>> swap_promises; |
| 62 layer_tree_host_src_->ToProtobufForCommit(&proto, &swap_promises); |
62 layer_tree_host_dst_->FromProtobufForCommit(proto); | 63 layer_tree_host_dst_->FromProtobufForCommit(proto); |
63 | 64 |
64 EXPECT_EQ(layer_tree_host_src_->needs_full_tree_sync_, | 65 EXPECT_EQ(layer_tree_host_src_->needs_full_tree_sync_, |
65 layer_tree_host_dst_->needs_full_tree_sync_); | 66 layer_tree_host_dst_->needs_full_tree_sync_); |
66 EXPECT_EQ(layer_tree_host_src_->needs_meta_info_recomputation_, | 67 EXPECT_EQ(layer_tree_host_src_->needs_meta_info_recomputation_, |
67 layer_tree_host_dst_->needs_meta_info_recomputation_); | 68 layer_tree_host_dst_->needs_meta_info_recomputation_); |
68 EXPECT_EQ(layer_tree_host_src_->source_frame_number_, | 69 EXPECT_EQ(layer_tree_host_src_->source_frame_number_, |
69 layer_tree_host_dst_->source_frame_number_); | 70 layer_tree_host_dst_->source_frame_number_); |
70 EXPECT_EQ(layer_tree_host_src_->root_layer()->id(), | 71 EXPECT_EQ(layer_tree_host_src_->root_layer()->id(), |
71 layer_tree_host_dst_->root_layer()->id()); | 72 layer_tree_host_dst_->root_layer()->id()); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 364 |
364 TEST_F(LayerTreeHostSerializationTest, LayersChangedMultipleSerializations) { | 365 TEST_F(LayerTreeHostSerializationTest, LayersChangedMultipleSerializations) { |
365 RunLayersChangedMultipleSerializations(); | 366 RunLayersChangedMultipleSerializations(); |
366 } | 367 } |
367 | 368 |
368 TEST_F(LayerTreeHostSerializationTest, AddAndRemoveNodeFromLayerTree) { | 369 TEST_F(LayerTreeHostSerializationTest, AddAndRemoveNodeFromLayerTree) { |
369 RunAddAndRemoveNodeFromLayerTree(); | 370 RunAddAndRemoveNodeFromLayerTree(); |
370 } | 371 } |
371 | 372 |
372 } // namespace cc | 373 } // namespace cc |
OLD | NEW |