| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 const T* Node(int i) const { | 79 const T* Node(int i) const { |
| 80 // TODO(vollick): remove this. | 80 // TODO(vollick): remove this. |
| 81 CHECK(i < static_cast<int>(nodes_.size())); | 81 CHECK(i < static_cast<int>(nodes_.size())); |
| 82 return i > -1 ? &nodes_[i] : nullptr; | 82 return i > -1 ? &nodes_[i] : nullptr; |
| 83 } | 83 } |
| 84 | 84 |
| 85 T* parent(const T* t) { return Node(t->parent_id); } | 85 T* parent(const T* t) { return Node(t->parent_id); } |
| 86 const T* parent(const T* t) const { return Node(t->parent_id); } | 86 const T* parent(const T* t) const { return Node(t->parent_id); } |
| 87 | 87 |
| 88 T* back() { return size() ? &nodes_[nodes_.size() - 1] : nullptr; } | 88 T* back() { return size() ? &nodes_.back() : nullptr; } |
| 89 const T* back() const { | 89 const T* back() const { return size() ? &nodes_.back() : nullptr; } |
| 90 return size() ? &nodes_[nodes_.size() - 1] : nullptr; | |
| 91 } | |
| 92 | 90 |
| 93 void clear(); | 91 void clear(); |
| 94 size_t size() const { return nodes_.size(); } | 92 size_t size() const { return nodes_.size(); } |
| 95 | 93 |
| 96 void set_needs_update(bool needs_update) { needs_update_ = needs_update; } | 94 void set_needs_update(bool needs_update) { needs_update_ = needs_update; } |
| 97 bool needs_update() const { return needs_update_; } | 95 bool needs_update() const { return needs_update_; } |
| 98 | 96 |
| 99 std::vector<T>& nodes() { return nodes_; } | 97 std::vector<T>& nodes() { return nodes_; } |
| 100 const std::vector<T>& nodes() const { return nodes_; } | 98 const std::vector<T>& nodes() const { return nodes_; } |
| 101 | 99 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 568 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
| 571 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 569 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
| 572 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 570 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
| 573 | 571 |
| 574 PropertyTreesCachedData cached_data_; | 572 PropertyTreesCachedData cached_data_; |
| 575 }; | 573 }; |
| 576 | 574 |
| 577 } // namespace cc | 575 } // namespace cc |
| 578 | 576 |
| 579 #endif // CC_TREES_PROPERTY_TREE_H_ | 577 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |