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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 2918163002: cc: Workaround invalid property tree state on Layers. (Closed)
Patch Set: .. Created 3 years, 6 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 } 979 }
980 980
981 ScrollTree& LayerImpl::GetScrollTree() const { 981 ScrollTree& LayerImpl::GetScrollTree() const {
982 return GetPropertyTrees()->scroll_tree; 982 return GetPropertyTrees()->scroll_tree;
983 } 983 }
984 984
985 TransformTree& LayerImpl::GetTransformTree() const { 985 TransformTree& LayerImpl::GetTransformTree() const {
986 return GetPropertyTrees()->transform_tree; 986 return GetPropertyTrees()->transform_tree;
987 } 987 }
988 988
989 bool LayerImpl::HasValidPropertyTreeIndices() const {
990 // TODO(crbug.com/726423): LayerImpls should never have invalid PropertyTree
991 // indices.
992 const bool has_valid_transform_node =
993 !!GetTransformTree().Node(transform_tree_index());
994 DCHECK(has_valid_transform_node);
995
996 const bool has_valid_effect_node =
997 !!GetEffectTree().Node(effect_tree_index());
998 DCHECK(has_valid_effect_node);
999
1000 const bool has_valid_clip_node = !!GetClipTree().Node(clip_tree_index());
1001 DCHECK(has_valid_clip_node);
1002
1003 const bool has_valid_scroll_node =
1004 !!GetScrollTree().Node(scroll_tree_index());
1005 DCHECK(has_valid_scroll_node);
1006
1007 return has_valid_transform_node && has_valid_effect_node &&
1008 has_valid_clip_node && has_valid_scroll_node;
1009 }
1010
989 } // namespace cc 1011 } // namespace cc
OLDNEW
« 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