| 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->child_at(i)); | 115 updateScrollbarLayerPointersRecursiveInternal<LayerType, ScrollbarLayerT
ype>(newLayers, layer->child_at(i)); |
| 116 | 116 |
| 117 ScrollbarLayerType* scrollbarLayer = layer->ToScrollbarLayer(); | 117 ScrollbarLayerType* scrollbarLayer = layer->ToScrollbarLayer(); |
| 118 if (!scrollbarLayer) | 118 // Pinch-zoom scrollbars will have an invalid scrollLayerId, but they are |
| 119 // managed by LayerTreeImpl and not LayerImpl, so should not be |
| 120 // processed here. |
| 121 if (!scrollbarLayer || (scrollbarLayer->scroll_layer_id() == Layer::PINCH_ZO
OM_ROOT_SCROLL_LAYER_ID)) |
| 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->scroll_layer_id()); | 126 iter = newLayers.find(scrollbarLayer->scroll_layer_id()); |
| 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 |