| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |