OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/tree_synchronizer.h" | 5 #include "cc/tree_synchronizer.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 template <typename LayerType, typename ScrollbarLayerType> | 108 template <typename LayerType, typename ScrollbarLayerType> |
109 void updateScrollbarLayerPointersRecursiveInternal(const RawPtrLayerImplMap& new Layers, LayerType* layer) | 109 void updateScrollbarLayerPointersRecursiveInternal(const RawPtrLayerImplMap& new Layers, LayerType* layer) |
110 { | 110 { |
111 if (!layer) | 111 if (!layer) |
112 return; | 112 return; |
113 | 113 |
114 for (size_t i = 0; i < layer->children().size(); ++i) | 114 for (size_t i = 0; i < layer->children().size(); ++i) |
115 updateScrollbarLayerPointersRecursiveInternal<LayerType, ScrollbarLayerT ype>(newLayers, layer->childAt(i)); | 115 updateScrollbarLayerPointersRecursiveInternal<LayerType, ScrollbarLayerT ype>(newLayers, layer->childAt(i)); |
116 | 116 |
117 ScrollbarLayerType* scrollbarLayer = layer->toScrollbarLayer(); | 117 ScrollbarLayerType* scrollbarLayer = layer->toScrollbarLayer(); |
118 if (!scrollbarLayer) | 118 // Pinch-zoom scrollbars will have a scrollLayerId of -1, but they are |
enne (OOO)
2013/03/06 19:32:58
Can you add a named constant to cc::Layer (since i
wjmaclean
2013/03/06 22:36:53
Done.
| |
119 // managed by LayerTreeImpl and not LayerImpl, so should not be | |
120 // processed here. | |
121 if (!scrollbarLayer || (scrollbarLayer->scrollLayerId() == -1)) | |
119 return; | 122 return; |
120 | 123 |
121 RawPtrLayerImplMap::const_iterator iter = newLayers.find(scrollbarLayer->id( )); | 124 RawPtrLayerImplMap::const_iterator iter = newLayers.find(scrollbarLayer->id( )); |
122 ScrollbarLayerImpl* scrollbarLayerImpl = iter != newLayers.end() ? static_ca st<ScrollbarLayerImpl*>(iter->second) : NULL; | 125 ScrollbarLayerImpl* scrollbarLayerImpl = iter != newLayers.end() ? static_ca st<ScrollbarLayerImpl*>(iter->second) : NULL; |
123 iter = newLayers.find(scrollbarLayer->scrollLayerId()); | 126 iter = newLayers.find(scrollbarLayer->scrollLayerId()); |
124 LayerImpl* scrollLayerImpl = iter != newLayers.end() ? iter->second : NULL; | 127 LayerImpl* scrollLayerImpl = iter != newLayers.end() ? iter->second : NULL; |
125 | 128 |
126 DCHECK(scrollbarLayerImpl); | 129 DCHECK(scrollbarLayerImpl); |
127 DCHECK(scrollLayerImpl); | 130 DCHECK(scrollLayerImpl); |
128 | 131 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 pushPropertiesInternal(layer, layerImpl); | 172 pushPropertiesInternal(layer, layerImpl); |
170 } | 173 } |
171 | 174 |
172 void TreeSynchronizer::pushProperties(LayerImpl* layer, LayerImpl* layerImpl) | 175 void TreeSynchronizer::pushProperties(LayerImpl* layer, LayerImpl* layerImpl) |
173 { | 176 { |
174 pushPropertiesInternal(layer, layerImpl); | 177 pushPropertiesInternal(layer, layerImpl); |
175 } | 178 } |
176 | 179 |
177 | 180 |
178 } // namespace cc | 181 } // namespace cc |
OLD | NEW |