| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/layers/empty_content_layer_client.h" | 10 #include "cc/layers/empty_content_layer_client.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 if (layer_tree_host_src_->outer_viewport_scroll_layer_) { | 199 if (layer_tree_host_src_->outer_viewport_scroll_layer_) { |
| 200 EXPECT_EQ(layer_tree_host_src_->outer_viewport_scroll_layer_->id(), | 200 EXPECT_EQ(layer_tree_host_src_->outer_viewport_scroll_layer_->id(), |
| 201 layer_tree_host_dst_->outer_viewport_scroll_layer_->id()); | 201 layer_tree_host_dst_->outer_viewport_scroll_layer_->id()); |
| 202 } else { | 202 } else { |
| 203 EXPECT_FALSE(layer_tree_host_dst_->outer_viewport_scroll_layer_); | 203 EXPECT_FALSE(layer_tree_host_dst_->outer_viewport_scroll_layer_); |
| 204 } | 204 } |
| 205 EXPECT_EQ(layer_tree_host_src_->selection_, | 205 EXPECT_EQ(layer_tree_host_src_->selection_, |
| 206 layer_tree_host_dst_->selection_); | 206 layer_tree_host_dst_->selection_); |
| 207 EXPECT_EQ(layer_tree_host_src_->property_trees_, | 207 EXPECT_EQ(layer_tree_host_src_->property_trees_, |
| 208 layer_tree_host_dst_->property_trees_); | 208 layer_tree_host_dst_->property_trees_); |
| 209 EXPECT_EQ(layer_tree_host_src_->surface_id_namespace_, | 209 EXPECT_EQ(layer_tree_host_src_->surface_client_id_, |
| 210 layer_tree_host_dst_->surface_id_namespace_); | 210 layer_tree_host_dst_->surface_client_id_); |
| 211 EXPECT_EQ(layer_tree_host_src_->next_surface_sequence_, | 211 EXPECT_EQ(layer_tree_host_src_->next_surface_sequence_, |
| 212 layer_tree_host_dst_->next_surface_sequence_); | 212 layer_tree_host_dst_->next_surface_sequence_); |
| 213 | 213 |
| 214 // All layers must have a property tree index that matches PropertyTrees. | 214 // All layers must have a property tree index that matches PropertyTrees. |
| 215 if (layer_tree_host_dst_->property_trees_.sequence_number) { | 215 if (layer_tree_host_dst_->property_trees_.sequence_number) { |
| 216 int seq_num = layer_tree_host_dst_->property_trees_.sequence_number; | 216 int seq_num = layer_tree_host_dst_->property_trees_.sequence_number; |
| 217 LayerTreeHostCommon::CallFunctionForEveryLayer( | 217 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 218 layer_tree_host_dst_.get(), [seq_num](Layer* layer) { | 218 layer_tree_host_dst_.get(), [seq_num](Layer* layer) { |
| 219 EXPECT_EQ(seq_num, layer->property_tree_sequence_number()); | 219 EXPECT_EQ(seq_num, layer->property_tree_sequence_number()); |
| 220 }); | 220 }); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 LayerSelectionBound sel_bound; | 287 LayerSelectionBound sel_bound; |
| 288 sel_bound.edge_top = gfx::Point(14, 3); | 288 sel_bound.edge_top = gfx::Point(14, 3); |
| 289 LayerSelection selection; | 289 LayerSelection selection; |
| 290 selection.start = sel_bound; | 290 selection.start = sel_bound; |
| 291 layer_tree_host_src_->selection_ = selection; | 291 layer_tree_host_src_->selection_ = selection; |
| 292 | 292 |
| 293 layer_tree_host_src_->property_trees_.sequence_number = | 293 layer_tree_host_src_->property_trees_.sequence_number = |
| 294 layer_tree_host_src_->property_trees_.sequence_number * 3 + 1; | 294 layer_tree_host_src_->property_trees_.sequence_number * 3 + 1; |
| 295 | 295 |
| 296 layer_tree_host_src_->surface_id_namespace_ = | 296 layer_tree_host_src_->surface_client_id_ = |
| 297 layer_tree_host_src_->surface_id_namespace_ * 3 + 1; | 297 layer_tree_host_src_->surface_client_id_ * 3 + 1; |
| 298 layer_tree_host_src_->next_surface_sequence_ = | 298 layer_tree_host_src_->next_surface_sequence_ = |
| 299 layer_tree_host_src_->next_surface_sequence_ * 3 + 1; | 299 layer_tree_host_src_->next_surface_sequence_ * 3 + 1; |
| 300 | 300 |
| 301 VerifySerializationAndDeserialization(); | 301 VerifySerializationAndDeserialization(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void RunLayersChangedTest() { | 304 void RunLayersChangedTest() { |
| 305 // Just fake setup a layer for both source and dest. | 305 // Just fake setup a layer for both source and dest. |
| 306 scoped_refptr<Layer> root_layer_src = Layer::Create(); | 306 scoped_refptr<Layer> root_layer_src = Layer::Create(); |
| 307 layer_tree_host_src_->SetRootLayer(root_layer_src); | 307 layer_tree_host_src_->SetRootLayer(root_layer_src); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 TEST_F(LayerTreeHostSerializationTest, AddAndRemoveNodeFromLayerTree) { | 448 TEST_F(LayerTreeHostSerializationTest, AddAndRemoveNodeFromLayerTree) { |
| 449 RunAddAndRemoveNodeFromLayerTree(); | 449 RunAddAndRemoveNodeFromLayerTree(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 TEST_F(LayerTreeHostSerializationTest, PictureLayerMultipleSerializations) { | 452 TEST_F(LayerTreeHostSerializationTest, PictureLayerMultipleSerializations) { |
| 453 RunPictureLayerMultipleSerializationsTest(); | 453 RunPictureLayerMultipleSerializationsTest(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace cc | 456 } // namespace cc |
| OLD | NEW |