Chromium Code Reviews| Index: cc/layers/layer_proto_converter.h |
| diff --git a/cc/layers/layer_proto_converter.h b/cc/layers/layer_proto_converter.h |
| index 29424a0347f392a2407518f2af57fbcc3bf51440..07de246ec2ecb6a45cfaa1fbe7861d2131d30e8d 100644 |
| --- a/cc/layers/layer_proto_converter.h |
| +++ b/cc/layers/layer_proto_converter.h |
| @@ -13,6 +13,7 @@ namespace cc { |
| namespace proto { |
| class LayerNode; |
| +class LayerUpdate; |
| } |
| // A class to faciliate (de)serialization of a Layer tree to protocol buffers. |
| @@ -31,6 +32,19 @@ class CC_EXPORT LayerProtoConverter { |
| scoped_refptr<Layer> existing_root, |
| const proto::LayerNode& root_node); |
| + // Starting at |root_layer|, serializes the properties of all the dirty nodes |
| + // in the Layer hierarchy. The proto::LayerUpdate will contain all nodes that |
| + // either are dirty or have dirty descendants. Only nodes that are dirty will |
| + // contain the list of dirty properties. |
| + static void SerializeLayerProperties(const scoped_refptr<Layer> root_layer, |
| + proto::LayerUpdate* layer_update); |
| + |
| + // Iterate over all updated layers from the LayerUpdate, and update the |
| + // local Layers. |
| + static void DeserializeLayerProperties( |
| + scoped_refptr<Layer> existing_root, |
| + const proto::LayerUpdate& layer_update); |
| + |
| // Returns the Layer with proto.id() as the Layer id, if it exists in |
| // |layer_id_map|. Otherwise, a new Layer is constructed of the type given |
| // from proto.type(). |
| @@ -42,6 +56,12 @@ class CC_EXPORT LayerProtoConverter { |
| LayerProtoConverter(); |
| ~LayerProtoConverter(); |
| + // This method is the inner recursive function for SerializeLayerProperties |
| + // declared above. |
| + static void RecursivelySerializeLayerProperties( |
| + const scoped_refptr<Layer> root_layer, |
|
vmpstr
2015/11/18 04:05:25
nit: const scoped_refptr<Layer>& root_layer
Or be
nyquist
2015/11/18 07:15:59
Done.
|
| + proto::LayerUpdate* layer_update); |
| + |
| using LayerIdMap = base::hash_map<int, scoped_refptr<Layer>>; |
| // Start at |layer| and recursively add |layer| and all its children and |
| // special layers to |layer_id_map|. |