Chromium Code Reviews| Index: cc/layers/layer.h |
| diff --git a/cc/layers/layer.h b/cc/layers/layer.h |
| index 5c298f5fd0b5fb03334c173bb8b8d54af1eb3c54..e6e1f8b52391779e5b662d3734d29fa59a8720f2 100644 |
| --- a/cc/layers/layer.h |
| +++ b/cc/layers/layer.h |
| @@ -69,6 +69,8 @@ struct AnimationEvent; |
| namespace proto { |
| class LayerNode; |
| +class LayerProperties; |
| +class LayerUpdate; |
| } // namespace proto |
| // Base class for composited layers. Special layer types are derived from |
| @@ -387,6 +389,20 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
| void FromLayerNodeProto(const proto::LayerNode& proto, |
| const LayerIdMap& layer_map); |
| + // Recursively iterate over this layer and all children to find layers with |
| + // changed properties. Layers that have changed properties and layers that |
| + // contain children that have changed properties are added to the |
| + // proto::LayerUpdate. Only layers with changed properties will contain |
| + // properties in the resulting proto::LayerProperties proto. This method also |
| + // resets |needs_push_properties_| and |num_dependents_need_push_properties_|. |
| + void ToLayerPropertiesProto(proto::LayerUpdate* layer_update); |
| + |
| + // Read all property values from the given LayerProperties object and update |
| + // the current layer. The values for |needs_push_properties_| and |
| + // |num_dependents_need_push_properties_| are always updated, but the rest |
| + // of |proto| is only read if |needs_push_properties_| is set. |
| + void FromLayerPropertiesProto(const proto::LayerProperties& proto); |
| + |
| LayerTreeHost* layer_tree_host() { return layer_tree_host_; } |
| const LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
| @@ -589,6 +605,22 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
| bool IsPropertyChangeAllowed() const; |
| + // Serialize all the necessary properties to be able to reconstruct this Layer |
| + // into proto::LayerProperties. This function must not set values for |
| + // |needs_push_properties_| or |num_dependents_need_push_properties_| as they |
| + // are dealt with at a higher level. This is only called if |
| + // |needs_push_properties_| is set. For descendants of Layer, implementations |
| + // must first call their parent class. |
| + virtual void LayerSpecificPropertiesToProto(proto::LayerProperties* proto); |
| + |
| + // Deerialize all the necessary properties from proto::LayerProperties into |
|
David Trainor- moved to gerrit
2015/11/11 15:34:22
Deerialize -> Deserialize
nyquist
2015/11/11 18:31:57
Done.
|
| + // this Layer. This function must not set values for |needs_push_properties_| |
| + // or |num_dependents_need_push_properties_| as they are dealt with at a |
| + // higher level. This is only called if |needs_push_properties_| is set. For |
| + // descendants of Layer, implementations must first call their parent class. |
| + virtual void FromLayerSpecificPropertiesProto( |
| + const proto::LayerProperties& proto); |
| + |
| // This flag is set when the layer needs to push properties to the impl |
| // side. |
| bool needs_push_properties_; |