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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 686057e68d576556caa1f265ed182a8e0ed52e47..16148a0977e7de10abb27e378feedcf2daf0ebfb 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -1435,6 +1435,17 @@ void LayerTreeHost::FromProtobufForCommit(const proto::LayerTreeHost& proto) {
property_trees_ = PropertyTrees();
property_trees_.FromProtobuf(proto.property_trees());
+ // Forcefully override the sequence number of all layers in the tree to have
+ // a valid sequence number. Changing the sequence number for a layer does not
+ // need a commit, so the value will become out of date for layers that are not
+ // updated for other reasons. All layers that at this point are part of the
+ // layer tree are valid, so it is OK that they have a valid sequence number.
+ int seq_num = property_trees_.sequence_number;
+ LayerTreeHostCommon::CallFunctionForSubtree(
+ root_layer(), [seq_num](Layer* layer) {
+ layer->set_property_tree_sequence_number(seq_num);
+ });
+
surface_id_namespace_ = proto.surface_id_namespace();
next_surface_sequence_ = proto.next_surface_sequence();
}
« 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