OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TREES_PROPERTY_TREE_H_ | 5 #ifndef CC_TREES_PROPERTY_TREE_H_ |
6 #define CC_TREES_PROPERTY_TREE_H_ | 6 #define CC_TREES_PROPERTY_TREE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ClipNodeData(); | 93 ClipNodeData(); |
94 | 94 |
95 gfx::RectF clip; | 95 gfx::RectF clip; |
96 gfx::RectF combined_clip; | 96 gfx::RectF combined_clip; |
97 int transform_id; | 97 int transform_id; |
98 int target_id; | 98 int target_id; |
99 }; | 99 }; |
100 | 100 |
101 typedef TreeNode<ClipNodeData> ClipNode; | 101 typedef TreeNode<ClipNodeData> ClipNode; |
102 | 102 |
| 103 typedef TreeNode<float> OpacityNode; |
| 104 |
103 template <typename T> | 105 template <typename T> |
104 class CC_EXPORT PropertyTree { | 106 class CC_EXPORT PropertyTree { |
105 public: | 107 public: |
106 PropertyTree(); | 108 PropertyTree(); |
107 virtual ~PropertyTree(); | 109 virtual ~PropertyTree(); |
108 | 110 |
109 int Insert(const T& tree_node, int parent_id); | 111 int Insert(const T& tree_node, int parent_id); |
110 | 112 |
111 T* Node(int i) { return i > -1 ? &nodes_[i] : nullptr; } | 113 T* Node(int i) { return i > -1 ? &nodes_[i] : nullptr; } |
112 const T* Node(int i) const { return i > -1 ? &nodes_[i] : nullptr; } | 114 const T* Node(int i) const { return i > -1 ? &nodes_[i] : nullptr; } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 TransformNode* target_node); | 177 TransformNode* target_node); |
176 void UpdateSublayerScale(TransformNode* node); | 178 void UpdateSublayerScale(TransformNode* node); |
177 void UpdateTargetSpaceTransform(TransformNode* node, | 179 void UpdateTargetSpaceTransform(TransformNode* node, |
178 TransformNode* target_node); | 180 TransformNode* target_node); |
179 void UpdateIsAnimated(TransformNode* node, TransformNode* parent_node); | 181 void UpdateIsAnimated(TransformNode* node, TransformNode* parent_node); |
180 void UpdateSnapping(TransformNode* node); | 182 void UpdateSnapping(TransformNode* node); |
181 }; | 183 }; |
182 | 184 |
183 class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {}; | 185 class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {}; |
184 | 186 |
| 187 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {}; |
| 188 |
185 } // namespace cc | 189 } // namespace cc |
186 | 190 |
187 #endif // CC_TREES_PROPERTY_TREE_H_ | 191 #endif // CC_TREES_PROPERTY_TREE_H_ |
OLD | NEW |