Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: cc/trees/layer_tree_host_unittest_serialization.cc

Issue 1921503005: cc: Move main thread hierarchy dependencies into PropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 layer_tree_host_src_->LayersThatShouldPushProperties(); 60 layer_tree_host_src_->LayersThatShouldPushProperties();
61 layer_tree_host_src_->ToProtobufForCommit(&proto); 61 layer_tree_host_src_->ToProtobufForCommit(&proto);
62 layer_tree_host_dst_->FromProtobufForCommit(proto); 62 layer_tree_host_dst_->FromProtobufForCommit(proto);
63 63
64 EXPECT_EQ(layer_tree_host_src_->needs_full_tree_sync_, 64 EXPECT_EQ(layer_tree_host_src_->needs_full_tree_sync_,
65 layer_tree_host_dst_->needs_full_tree_sync_); 65 layer_tree_host_dst_->needs_full_tree_sync_);
66 EXPECT_EQ(layer_tree_host_src_->needs_meta_info_recomputation_, 66 EXPECT_EQ(layer_tree_host_src_->needs_meta_info_recomputation_,
67 layer_tree_host_dst_->needs_meta_info_recomputation_); 67 layer_tree_host_dst_->needs_meta_info_recomputation_);
68 EXPECT_EQ(layer_tree_host_src_->source_frame_number_, 68 EXPECT_EQ(layer_tree_host_src_->source_frame_number_,
69 layer_tree_host_dst_->source_frame_number_); 69 layer_tree_host_dst_->source_frame_number_);
70 EXPECT_EQ(layer_tree_host_src_->meta_information_sequence_number_,
71 layer_tree_host_dst_->meta_information_sequence_number_);
72 EXPECT_EQ(layer_tree_host_src_->root_layer()->id(), 70 EXPECT_EQ(layer_tree_host_src_->root_layer()->id(),
73 layer_tree_host_dst_->root_layer()->id()); 71 layer_tree_host_dst_->root_layer()->id());
74 EXPECT_EQ(layer_tree_host_dst_.get(), 72 EXPECT_EQ(layer_tree_host_dst_.get(),
75 layer_tree_host_dst_->root_layer_->layer_tree_host()); 73 layer_tree_host_dst_->root_layer_->layer_tree_host());
76 EXPECT_EQ(layer_tree_host_src_->root_layer_->double_sided(), 74 EXPECT_EQ(layer_tree_host_src_->root_layer_->double_sided(),
77 layer_tree_host_dst_->root_layer_->double_sided()); 75 layer_tree_host_dst_->root_layer_->double_sided());
78 EXPECT_EQ( 76 EXPECT_EQ(
79 layer_tree_host_src_->debug_state_.show_replica_screen_space_rects, 77 layer_tree_host_src_->debug_state_.show_replica_screen_space_rects,
80 layer_tree_host_dst_->debug_state_.show_replica_screen_space_rects); 78 layer_tree_host_dst_->debug_state_.show_replica_screen_space_rects);
81 EXPECT_EQ(layer_tree_host_src_->device_viewport_size_, 79 EXPECT_EQ(layer_tree_host_src_->device_viewport_size_,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 }); 175 });
178 } 176 }
179 } 177 }
180 178
181 void RunAllMembersChangedTest() { 179 void RunAllMembersChangedTest() {
182 layer_tree_host_src_->needs_full_tree_sync_ = 180 layer_tree_host_src_->needs_full_tree_sync_ =
183 !layer_tree_host_src_->needs_full_tree_sync_; 181 !layer_tree_host_src_->needs_full_tree_sync_;
184 layer_tree_host_src_->needs_meta_info_recomputation_ = 182 layer_tree_host_src_->needs_meta_info_recomputation_ =
185 !layer_tree_host_src_->needs_meta_info_recomputation_; 183 !layer_tree_host_src_->needs_meta_info_recomputation_;
186 layer_tree_host_src_->source_frame_number_ *= 3; 184 layer_tree_host_src_->source_frame_number_ *= 3;
187 layer_tree_host_src_->meta_information_sequence_number_ *= 3;
188 185
189 // Just fake setup a layer for both source and dest. 186 // Just fake setup a layer for both source and dest.
190 scoped_refptr<Layer> root_layer_src = Layer::Create(); 187 scoped_refptr<Layer> root_layer_src = Layer::Create();
191 layer_tree_host_src_->SetRootLayer(root_layer_src); 188 layer_tree_host_src_->SetRootLayer(root_layer_src);
192 layer_tree_host_dst_->SetRootLayer(Layer::Create()); 189 layer_tree_host_dst_->SetRootLayer(Layer::Create());
193 root_layer_src->SetDoubleSided(!root_layer_src->double_sided()); 190 root_layer_src->SetDoubleSided(!root_layer_src->double_sided());
194 191
195 layer_tree_host_src_->debug_state_.show_replica_screen_space_rects = 192 layer_tree_host_src_->debug_state_.show_replica_screen_space_rects =
196 !layer_tree_host_src_->debug_state_.show_replica_screen_space_rects; 193 !layer_tree_host_src_->debug_state_.show_replica_screen_space_rects;
197 layer_tree_host_src_->device_viewport_size_ = gfx::Size(3, 14); 194 layer_tree_host_src_->device_viewport_size_ = gfx::Size(3, 14);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 363
367 TEST_F(LayerTreeHostSerializationTest, LayersChangedMultipleSerializations) { 364 TEST_F(LayerTreeHostSerializationTest, LayersChangedMultipleSerializations) {
368 RunLayersChangedMultipleSerializations(); 365 RunLayersChangedMultipleSerializations();
369 } 366 }
370 367
371 TEST_F(LayerTreeHostSerializationTest, AddAndRemoveNodeFromLayerTree) { 368 TEST_F(LayerTreeHostSerializationTest, AddAndRemoveNodeFromLayerTree) {
372 RunAddAndRemoveNodeFromLayerTree(); 369 RunAddAndRemoveNodeFromLayerTree();
373 } 370 }
374 371
375 } // namespace cc 372 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698