| Index: cc/trees/property_tree.h
|
| diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h
|
| index 6f26ef68768c594a9ce8a86c524b0ea374a50799..9a0446bad6fcbd21186d0651b61b4a8dfe590a47 100644
|
| --- a/cc/trees/property_tree.h
|
| +++ b/cc/trees/property_tree.h
|
| @@ -15,6 +15,18 @@
|
|
|
| namespace cc {
|
|
|
| +namespace proto {
|
| +class ClipNodeData;
|
| +class ClipTree;
|
| +class EffectNodeData;
|
| +class EffectTree;
|
| +class PropertyTree;
|
| +class PropertyTrees;
|
| +class TranformNodeData;
|
| +class TransformTree;
|
| +class TreeNode;
|
| +}
|
| +
|
| template <typename T>
|
| struct CC_EXPORT TreeNode {
|
| TreeNode() : id(-1), parent_id(-1), owner_id(-1), data() {}
|
| @@ -22,6 +34,9 @@ struct CC_EXPORT TreeNode {
|
| int parent_id;
|
| int owner_id;
|
| T data;
|
| +
|
| + void ToProtobuf(proto::TreeNode* proto) const;
|
| + void FromProtobuf(const proto::TreeNode& proto);
|
| };
|
|
|
| struct CC_EXPORT TransformNodeData {
|
| @@ -150,6 +165,9 @@ struct CC_EXPORT TransformNodeData {
|
|
|
| void update_post_local_transform(const gfx::PointF& position,
|
| const gfx::Point3F& transform_origin);
|
| +
|
| + void ToProtobuf(proto::TreeNode* proto) const;
|
| + void FromProtobuf(const proto::TreeNode& proto);
|
| };
|
|
|
| typedef TreeNode<TransformNodeData> TransformNode;
|
| @@ -198,6 +216,9 @@ struct CC_EXPORT ClipNodeData {
|
|
|
| // Nodes that correspond to unclipped surfaces disregard ancestor clips.
|
| bool resets_clip : 1;
|
| +
|
| + void ToProtobuf(proto::TreeNode* proto) const;
|
| + void FromProtobuf(const proto::TreeNode& proto);
|
| };
|
|
|
| typedef TreeNode<ClipNodeData> ClipNode;
|
| @@ -211,6 +232,11 @@ struct CC_EXPORT EffectNodeData {
|
| bool has_render_surface;
|
| int transform_id;
|
| int clip_id;
|
| +
|
| + bool operator==(const EffectNodeData& other) const;
|
| +
|
| + void ToProtobuf(proto::TreeNode* proto) const;
|
| + void FromProtobuf(const proto::TreeNode& proto);
|
| };
|
|
|
| typedef TreeNode<EffectNodeData> EffectNode;
|
| @@ -250,6 +276,9 @@ class CC_EXPORT PropertyTree {
|
|
|
| int next_available_id() const { return static_cast<int>(size()); }
|
|
|
| + void ToProtobuf(proto::PropertyTree* proto) const;
|
| + void FromProtobuf(const proto::PropertyTree& proto);
|
| +
|
| private:
|
| // Copy and assign are permitted. This is how we do tree sync.
|
| std::vector<T> nodes_;
|
| @@ -348,6 +377,9 @@ class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> {
|
| bool HasNodesAffectedByInnerViewportBoundsDelta() const;
|
| bool HasNodesAffectedByOuterViewportBoundsDelta() const;
|
|
|
| + void ToProtobuf(proto::TransformTree* proto) const;
|
| + void FromProtobuf(const proto::TransformTree& proto);
|
| +
|
| private:
|
| // Returns true iff the node at |desc_id| is a descendant of the node at
|
| // |anc_id|.
|
| @@ -400,17 +432,26 @@ class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {
|
| public:
|
| void SetViewportClip(gfx::RectF viewport_rect);
|
| gfx::RectF ViewportClip();
|
| +
|
| + void ToProtobuf(proto::ClipTree* proto) const;
|
| + void FromProtobuf(const proto::ClipTree& proto);
|
| };
|
|
|
| class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
|
| public:
|
| void UpdateOpacities(int id);
|
| +
|
| + void ToProtobuf(proto::EffectTree* proto) const;
|
| + void FromProtobuf(const proto::EffectTree& proto);
|
| };
|
|
|
| class CC_EXPORT PropertyTrees final {
|
| public:
|
| PropertyTrees();
|
|
|
| + static PropertyTrees CreateFromProtobuf(const proto::PropertyTrees& proto);
|
| + void ToProtobuf(proto::PropertyTrees* proto) const;
|
| +
|
| TransformTree transform_tree;
|
| EffectTree effect_tree;
|
| ClipTree clip_tree;
|
|
|