Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4255)

Unified Diff: cc/trees/property_tree.h

Issue 1139573004: Reset property tree indices when layer is removed from layer tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use sequence numbers to invalidate property tree indices. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.h
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h
index 209c8a98715c1c2065a8b8d9a923e6c2ca95d7da..83b33afd676925c29d40a7969819e254c97a9159 100644
--- a/cc/trees/property_tree.h
+++ b/cc/trees/property_tree.h
@@ -141,8 +141,16 @@ class CC_EXPORT PropertyTree {
int Insert(const T& tree_node, int parent_id);
- T* Node(int i) { return i > -1 ? &nodes_[i] : nullptr; }
- const T* Node(int i) const { return i > -1 ? &nodes_[i] : nullptr; }
+ T* Node(int i) {
+ // TODO(vollick): remove this.
+ CHECK(i < static_cast<int>(nodes_.size()));
+ return i > -1 ? &nodes_[i] : nullptr;
+ }
+ const T* Node(int i) const {
+ // TODO(vollick): remove this.
+ CHECK(i < static_cast<int>(nodes_.size()));
+ return i > -1 ? &nodes_[i] : nullptr;
+ }
T* parent(const T* t) { return Node(t->parent_id); }
const T* parent(const T* t) const { return Node(t->parent_id); }
@@ -246,6 +254,7 @@ class CC_EXPORT PropertyTrees final {
OpacityTree opacity_tree;
ClipTree clip_tree;
bool needs_rebuild;
+ int sequence_number;
};
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698