| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 typedef TreeNode<float> OpacityNode; | 134 typedef TreeNode<float> OpacityNode; |
| 135 | 135 |
| 136 template <typename T> | 136 template <typename T> |
| 137 class CC_EXPORT PropertyTree { | 137 class CC_EXPORT PropertyTree { |
| 138 public: | 138 public: |
| 139 PropertyTree(); | 139 PropertyTree(); |
| 140 virtual ~PropertyTree(); | 140 virtual ~PropertyTree(); |
| 141 | 141 |
| 142 int Insert(const T& tree_node, int parent_id); | 142 int Insert(const T& tree_node, int parent_id); |
| 143 | 143 |
| 144 T* Node(int i) { return i > -1 ? &nodes_[i] : nullptr; } | 144 T* Node(int i) { |
| 145 const T* Node(int i) const { return i > -1 ? &nodes_[i] : nullptr; } | 145 // TODO(vollick): remove this. |
| 146 CHECK(i < static_cast<int>(nodes_.size())); |
| 147 return i > -1 ? &nodes_[i] : nullptr; |
| 148 } |
| 149 const T* Node(int i) const { |
| 150 // TODO(vollick): remove this. |
| 151 CHECK(i < static_cast<int>(nodes_.size())); |
| 152 return i > -1 ? &nodes_[i] : nullptr; |
| 153 } |
| 146 | 154 |
| 147 T* parent(const T* t) { return Node(t->parent_id); } | 155 T* parent(const T* t) { return Node(t->parent_id); } |
| 148 const T* parent(const T* t) const { return Node(t->parent_id); } | 156 const T* parent(const T* t) const { return Node(t->parent_id); } |
| 149 | 157 |
| 150 T* back() { return size() ? &nodes_[nodes_.size() - 1] : nullptr; } | 158 T* back() { return size() ? &nodes_[nodes_.size() - 1] : nullptr; } |
| 151 const T* back() const { | 159 const T* back() const { |
| 152 return size() ? &nodes_[nodes_.size() - 1] : nullptr; | 160 return size() ? &nodes_[nodes_.size() - 1] : nullptr; |
| 153 } | 161 } |
| 154 | 162 |
| 155 void clear(); | 163 void clear(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {}; | 247 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {}; |
| 240 | 248 |
| 241 class CC_EXPORT PropertyTrees final { | 249 class CC_EXPORT PropertyTrees final { |
| 242 public: | 250 public: |
| 243 PropertyTrees(); | 251 PropertyTrees(); |
| 244 | 252 |
| 245 TransformTree transform_tree; | 253 TransformTree transform_tree; |
| 246 OpacityTree opacity_tree; | 254 OpacityTree opacity_tree; |
| 247 ClipTree clip_tree; | 255 ClipTree clip_tree; |
| 248 bool needs_rebuild; | 256 bool needs_rebuild; |
| 257 int sequence_number; |
| 249 }; | 258 }; |
| 250 | 259 |
| 251 } // namespace cc | 260 } // namespace cc |
| 252 | 261 |
| 253 #endif // CC_TREES_PROPERTY_TREE_H_ | 262 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |