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

Unified Diff: cc/layers/layer_impl.cc

Issue 2918163002: cc: Workaround invalid property tree state on Layers. (Closed)
Patch Set: .. Created 3 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/layers/layer_impl.h ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 57cb1b4a3de5abed980fd9765511fee56adb1381..1820e1b56410c7c1c904c3b88dd8f42a9780af04 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -986,4 +986,26 @@ TransformTree& LayerImpl::GetTransformTree() const {
return GetPropertyTrees()->transform_tree;
}
+bool LayerImpl::HasValidPropertyTreeIndices() const {
+ // TODO(crbug.com/726423): LayerImpls should never have invalid PropertyTree
+ // indices.
+ const bool has_valid_transform_node =
+ !!GetTransformTree().Node(transform_tree_index());
+ DCHECK(has_valid_transform_node);
+
+ const bool has_valid_effect_node =
+ !!GetEffectTree().Node(effect_tree_index());
+ DCHECK(has_valid_effect_node);
+
+ const bool has_valid_clip_node = !!GetClipTree().Node(clip_tree_index());
+ DCHECK(has_valid_clip_node);
+
+ const bool has_valid_scroll_node =
+ !!GetScrollTree().Node(scroll_tree_index());
+ DCHECK(has_valid_scroll_node);
+
+ return has_valid_transform_node && has_valid_effect_node &&
+ has_valid_clip_node && has_valid_scroll_node;
+}
+
} // namespace cc
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698