| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 layerImpl->clearChildList(); | 84 layerImpl->clearChildList(); |
| 85 for (size_t i = 0; i < layer->children().size(); ++i) | 85 for (size_t i = 0; i < layer->children().size(); ++i) |
| 86 layerImpl->addChild(synchronizeTreesRecursiveInternal(newLayers, oldLaye
rs, layer->childAt(i), treeImpl)); | 86 layerImpl->addChild(synchronizeTreesRecursiveInternal(newLayers, oldLaye
rs, layer->childAt(i), treeImpl)); |
| 87 | 87 |
| 88 layerImpl->setMaskLayer(synchronizeTreesRecursiveInternal(newLayers, oldLaye
rs, layer->maskLayer(), treeImpl)); | 88 layerImpl->setMaskLayer(synchronizeTreesRecursiveInternal(newLayers, oldLaye
rs, layer->maskLayer(), treeImpl)); |
| 89 layerImpl->setReplicaLayer(synchronizeTreesRecursiveInternal(newLayers, oldL
ayers, layer->replicaLayer(), treeImpl)); | 89 layerImpl->setReplicaLayer(synchronizeTreesRecursiveInternal(newLayers, oldL
ayers, layer->replicaLayer(), treeImpl)); |
| 90 | 90 |
| 91 // Remove all dangling pointers. The pointers will be setup later in updateS
crollbarLayerPointersRecursive phase | 91 // Remove all dangling pointers. The pointers will be setup later in updateS
crollbarLayerPointersRecursive phase |
| 92 layerImpl->setHorizontalScrollbarLayer(0); | 92 layerImpl->setHorizontalScrollbarLayer(0); |
| 93 layerImpl->setVerticalScrollbarLayer(0); | 93 layerImpl->setVerticalScrollbarLayer(0); |
| 94 layerImpl->setHorizontalPinchZoomScrollbarLayer(0); |
| 95 layerImpl->setVerticalPinchZoomScrollbarLayer(0); |
| 94 | 96 |
| 95 return layerImpl.Pass(); | 97 return layerImpl.Pass(); |
| 96 } | 98 } |
| 97 | 99 |
| 98 scoped_ptr<LayerImpl> synchronizeTreesRecursive(RawPtrLayerImplMap& newLayers, S
copedPtrLayerImplMap& oldLayers, Layer* layer, LayerTreeImpl* treeImpl) | 100 scoped_ptr<LayerImpl> synchronizeTreesRecursive(RawPtrLayerImplMap& newLayers, S
copedPtrLayerImplMap& oldLayers, Layer* layer, LayerTreeImpl* treeImpl) |
| 99 { | 101 { |
| 100 return synchronizeTreesRecursiveInternal(newLayers, oldLayers, layer, treeIm
pl); | 102 return synchronizeTreesRecursiveInternal(newLayers, oldLayers, layer, treeIm
pl); |
| 101 } | 103 } |
| 102 | 104 |
| 103 scoped_ptr<LayerImpl> synchronizeTreesRecursive(RawPtrLayerImplMap& newLayers, S
copedPtrLayerImplMap& oldLayers, LayerImpl* layer, LayerTreeImpl* treeImpl) | 105 scoped_ptr<LayerImpl> synchronizeTreesRecursive(RawPtrLayerImplMap& newLayers, S
copedPtrLayerImplMap& oldLayers, LayerImpl* layer, LayerTreeImpl* treeImpl) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 119 return; | 121 return; |
| 120 | 122 |
| 121 RawPtrLayerImplMap::const_iterator iter = newLayers.find(scrollbarLayer->id(
)); | 123 RawPtrLayerImplMap::const_iterator iter = newLayers.find(scrollbarLayer->id(
)); |
| 122 ScrollbarLayerImpl* scrollbarLayerImpl = iter != newLayers.end() ? static_ca
st<ScrollbarLayerImpl*>(iter->second) : NULL; | 124 ScrollbarLayerImpl* scrollbarLayerImpl = iter != newLayers.end() ? static_ca
st<ScrollbarLayerImpl*>(iter->second) : NULL; |
| 123 iter = newLayers.find(scrollbarLayer->scrollLayerId()); | 125 iter = newLayers.find(scrollbarLayer->scrollLayerId()); |
| 124 LayerImpl* scrollLayerImpl = iter != newLayers.end() ? iter->second : NULL; | 126 LayerImpl* scrollLayerImpl = iter != newLayers.end() ? iter->second : NULL; |
| 125 | 127 |
| 126 DCHECK(scrollbarLayerImpl); | 128 DCHECK(scrollbarLayerImpl); |
| 127 DCHECK(scrollLayerImpl); | 129 DCHECK(scrollLayerImpl); |
| 128 | 130 |
| 129 if (scrollbarLayer->orientation() == WebKit::WebScrollbar::Horizontal) | 131 if (scrollbarLayer->isPinchZoomScrollbar()) { |
| 130 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); | 132 if (scrollbarLayer->orientation() == WebKit::WebScrollbar::Horizontal) |
| 131 else | 133 scrollLayerImpl->setHorizontalPinchZoomScrollbarLayer(scrollbarLayer
Impl); |
| 132 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); | 134 else |
| 135 scrollLayerImpl->setVerticalPinchZoomScrollbarLayer(scrollbarLayerIm
pl); |
| 136 } else { |
| 137 if (scrollbarLayer->orientation() == WebKit::WebScrollbar::Horizontal) |
| 138 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); |
| 139 else |
| 140 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); |
| 141 } |
| 133 } | 142 } |
| 134 | 143 |
| 135 void updateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap& newLayers,
Layer* layer) | 144 void updateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap& newLayers,
Layer* layer) |
| 136 { | 145 { |
| 137 updateScrollbarLayerPointersRecursiveInternal<Layer, ScrollbarLayer>(newLaye
rs, layer); | 146 updateScrollbarLayerPointersRecursiveInternal<Layer, ScrollbarLayer>(newLaye
rs, layer); |
| 138 } | 147 } |
| 139 | 148 |
| 140 void updateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap& newLayers,
LayerImpl* layer) | 149 void updateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap& newLayers,
LayerImpl* layer) |
| 141 { | 150 { |
| 142 updateScrollbarLayerPointersRecursiveInternal<LayerImpl, ScrollbarLayerImpl>
(newLayers, layer); | 151 updateScrollbarLayerPointersRecursiveInternal<LayerImpl, ScrollbarLayerImpl>
(newLayers, layer); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 169 pushPropertiesInternal(layer, layerImpl); | 178 pushPropertiesInternal(layer, layerImpl); |
| 170 } | 179 } |
| 171 | 180 |
| 172 void TreeSynchronizer::pushProperties(LayerImpl* layer, LayerImpl* layerImpl) | 181 void TreeSynchronizer::pushProperties(LayerImpl* layer, LayerImpl* layerImpl) |
| 173 { | 182 { |
| 174 pushPropertiesInternal(layer, layerImpl); | 183 pushPropertiesInternal(layer, layerImpl); |
| 175 } | 184 } |
| 176 | 185 |
| 177 | 186 |
| 178 } // namespace cc | 187 } // namespace cc |
| OLD | NEW |