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

Side by Side Diff: cc/trees/layer_tree_host.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/layers/layer.h ('k') | cc/trees/layer_tree_host_unittest_serialization.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 outer_viewport_scroll_layer_ = 1428 outer_viewport_scroll_layer_ =
1429 UpdateAndGetLayer(outer_viewport_scroll_layer_.get(), 1429 UpdateAndGetLayer(outer_viewport_scroll_layer_.get(),
1430 proto.outer_viewport_scroll_layer_id(), layer_id_map_); 1430 proto.outer_viewport_scroll_layer_id(), layer_id_map_);
1431 1431
1432 LayerSelectionFromProtobuf(&selection_, proto.selection()); 1432 LayerSelectionFromProtobuf(&selection_, proto.selection());
1433 1433
1434 // It is required to create new PropertyTrees before deserializing it. 1434 // It is required to create new PropertyTrees before deserializing it.
1435 property_trees_ = PropertyTrees(); 1435 property_trees_ = PropertyTrees();
1436 property_trees_.FromProtobuf(proto.property_trees()); 1436 property_trees_.FromProtobuf(proto.property_trees());
1437 1437
1438 // Forcefully override the sequence number of all layers in the tree to have
1439 // a valid sequence number. Changing the sequence number for a layer does not
1440 // need a commit, so the value will become out of date for layers that are not
1441 // updated for other reasons. All layers that at this point are part of the
1442 // layer tree are valid, so it is OK that they have a valid sequence number.
1443 int seq_num = property_trees_.sequence_number;
1444 LayerTreeHostCommon::CallFunctionForSubtree(
1445 root_layer(), [seq_num](Layer* layer) {
1446 layer->set_property_tree_sequence_number(seq_num);
1447 });
1448
1438 surface_id_namespace_ = proto.surface_id_namespace(); 1449 surface_id_namespace_ = proto.surface_id_namespace();
1439 next_surface_sequence_ = proto.next_surface_sequence(); 1450 next_surface_sequence_ = proto.next_surface_sequence();
1440 } 1451 }
1441 1452
1442 } // namespace cc 1453 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/layer_tree_host_unittest_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698