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

Unified Diff: cc/layers/layer_proto_converter.cc

Issue 1808373002: cc : Make tree synchronization independent of layer tree hierarchy (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: cc/layers/layer_proto_converter.cc
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc
index 19215c9f92eed97ed73c612baee5c553c9a2b0fd..6cdd76eaeaea84603ca2e1276ea607bdbb2aeb55 100644
--- a/cc/layers/layer_proto_converter.cc
+++ b/cc/layers/layer_proto_converter.cc
@@ -48,9 +48,11 @@ scoped_refptr<Layer> LayerProtoConverter::DeserializeLayerHierarchy(
// static
void LayerProtoConverter::SerializeLayerProperties(
- Layer* root_layer,
+ LayerTreeHost* host,
proto::LayerUpdate* layer_update) {
- RecursivelySerializeLayerProperties(root_layer, layer_update);
+ for (auto layer : host->LayersThatShouldPushProperties())
+ layer->ToLayerPropertiesProto(layer_update);
+ host->LayersThatShouldPushProperties().clear();
}
// static
@@ -73,23 +75,6 @@ void LayerProtoConverter::DeserializeLayerProperties(
}
// static
-void LayerProtoConverter::RecursivelySerializeLayerProperties(
- Layer* layer,
- proto::LayerUpdate* layer_update) {
- bool serialize_descendants = layer->ToLayerPropertiesProto(layer_update);
- if (!serialize_descendants)
- return;
-
- for (const auto& child : layer->children()) {
- RecursivelySerializeLayerProperties(child.get(), layer_update);
- }
- if (layer->mask_layer())
- RecursivelySerializeLayerProperties(layer->mask_layer(), layer_update);
- if (layer->replica_layer())
- RecursivelySerializeLayerProperties(layer->replica_layer(), layer_update);
-}
-
-// static
void LayerProtoConverter::RecursivelyFindAllLayers(
const scoped_refptr<Layer>& layer,
LayerIdMap* layer_id_map) {

Powered by Google App Engine
This is Rietveld 408576698