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

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

Issue 1584653004: Ensure Layers have valid sequence numbers for PropertyTrees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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.cc ('k') | no next file » | 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/layers/layer_settings.h" 9 #include "cc/layers/layer_settings.h"
10 #include "cc/proto/layer.pb.h" 10 #include "cc/proto/layer.pb.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 EXPECT_EQ(nullptr, layer_tree_host_dst_->outer_viewport_scroll_layer_); 135 EXPECT_EQ(nullptr, layer_tree_host_dst_->outer_viewport_scroll_layer_);
136 } 136 }
137 EXPECT_EQ(layer_tree_host_src_->selection_, 137 EXPECT_EQ(layer_tree_host_src_->selection_,
138 layer_tree_host_dst_->selection_); 138 layer_tree_host_dst_->selection_);
139 EXPECT_EQ(layer_tree_host_src_->property_trees_, 139 EXPECT_EQ(layer_tree_host_src_->property_trees_,
140 layer_tree_host_dst_->property_trees_); 140 layer_tree_host_dst_->property_trees_);
141 EXPECT_EQ(layer_tree_host_src_->surface_id_namespace_, 141 EXPECT_EQ(layer_tree_host_src_->surface_id_namespace_,
142 layer_tree_host_dst_->surface_id_namespace_); 142 layer_tree_host_dst_->surface_id_namespace_);
143 EXPECT_EQ(layer_tree_host_src_->next_surface_sequence_, 143 EXPECT_EQ(layer_tree_host_src_->next_surface_sequence_,
144 layer_tree_host_dst_->next_surface_sequence_); 144 layer_tree_host_dst_->next_surface_sequence_);
145
146 // All layers must have a property tree index that matches PropertyTrees.
147 if (layer_tree_host_dst_->property_trees_.sequence_number) {
148 int seq_num = layer_tree_host_dst_->property_trees_.sequence_number;
149 LayerTreeHostCommon::CallFunctionForSubtree(
150 layer_tree_host_dst_->root_layer_.get(), [seq_num](Layer* layer) {
151 EXPECT_EQ(seq_num, layer->property_tree_sequence_number());
152 });
153 }
145 } 154 }
146 155
147 void RunAllMembersChangedTest() { 156 void RunAllMembersChangedTest() {
148 layer_tree_host_src_->needs_full_tree_sync_ = 157 layer_tree_host_src_->needs_full_tree_sync_ =
149 !layer_tree_host_src_->needs_full_tree_sync_; 158 !layer_tree_host_src_->needs_full_tree_sync_;
150 layer_tree_host_src_->needs_meta_info_recomputation_ = 159 layer_tree_host_src_->needs_meta_info_recomputation_ =
151 !layer_tree_host_src_->needs_meta_info_recomputation_; 160 !layer_tree_host_src_->needs_meta_info_recomputation_;
152 layer_tree_host_src_->source_frame_number_ *= 3; 161 layer_tree_host_src_->source_frame_number_ *= 3;
153 layer_tree_host_src_->meta_information_sequence_number_ *= 3; 162 layer_tree_host_src_->meta_information_sequence_number_ *= 3;
154 163
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 313
305 TEST_F(LayerTreeHostSerializationTest, LayersChanged) { 314 TEST_F(LayerTreeHostSerializationTest, LayersChanged) {
306 RunLayersChangedTest(); 315 RunLayersChangedTest();
307 } 316 }
308 317
309 TEST_F(LayerTreeHostSerializationTest, LayersChangedMultipleSerializations) { 318 TEST_F(LayerTreeHostSerializationTest, LayersChangedMultipleSerializations) {
310 LayersChangedMultipleSerializations(); 319 LayersChangedMultipleSerializations();
311 } 320 }
312 321
313 } // namespace cc 322 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698