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

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
« no previous file with comments | « cc/layers/layer_proto_converter.h ('k') | cc/layers/layer_proto_converter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_proto_converter.cc
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc
index 27c76ae38d60188aded9d550552229ee7bd0fb09..626380dea1cb205b314b28b68b21ea2b217eaad6 100644
--- a/cc/layers/layer_proto_converter.cc
+++ b/cc/layers/layer_proto_converter.cc
@@ -10,6 +10,7 @@
#include "cc/layers/layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/proto/layer.pb.h"
+#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/layer_tree_settings.h"
@@ -47,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
@@ -72,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(Layer* root_layer,
LayerIdMap* layer_id_map) {
LayerTreeHostCommon::CallFunctionForSubtree(
« no previous file with comments | « cc/layers/layer_proto_converter.h ('k') | cc/layers/layer_proto_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698