| 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 "cc/layer.h" | 7 #include "cc/layer.h" |
| 8 #include "cc/layer_impl.h" | 8 #include "cc/layer_impl.h" |
| 9 #include "cc/scrollbar_animation_controller.h" | 9 #include "cc/scrollbar_animation_controller.h" |
| 10 #include "cc/scrollbar_layer.h" | 10 #include "cc/scrollbar_layer.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 return newTree.Pass(); | 26 return newTree.Pass(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void TreeSynchronizer::collectExistingLayerImplRecursive(ScopedPtrLayerImplMap&
oldLayers, scoped_ptr<LayerImpl> layerImpl) | 29 void TreeSynchronizer::collectExistingLayerImplRecursive(ScopedPtrLayerImplMap&
oldLayers, scoped_ptr<LayerImpl> layerImpl) |
| 30 { | 30 { |
| 31 if (!layerImpl) | 31 if (!layerImpl) |
| 32 return; | 32 return; |
| 33 | 33 |
| 34 ScopedPtrVector<LayerImpl>& children = layerImpl->m_children; | 34 ScopedPtrVector<LayerImpl>& children = layerImpl->m_children; |
| 35 for (size_t i = 0; i < children.size(); ++i) | 35 for (ScopedPtrVector<LayerImpl>::iterator it = children.begin(); it != child
ren.end(); ++it) |
| 36 collectExistingLayerImplRecursive(oldLayers, children.take(i)); | 36 collectExistingLayerImplRecursive(oldLayers, children.take(it)); |
| 37 | 37 |
| 38 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_maskLayer.Pass()); | 38 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_maskLayer.Pass()); |
| 39 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_replicaLayer.Pass(
)); | 39 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_replicaLayer.Pass(
)); |
| 40 | 40 |
| 41 int id = layerImpl->id(); | 41 int id = layerImpl->id(); |
| 42 oldLayers.set(id, layerImpl.Pass()); | 42 oldLayers.set(id, layerImpl.Pass()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 scoped_ptr<LayerImpl> TreeSynchronizer::reuseOrCreateLayerImpl(RawPtrLayerImplMa
p& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer) | 45 scoped_ptr<LayerImpl> TreeSynchronizer::reuseOrCreateLayerImpl(RawPtrLayerImplMa
p& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer) |
| 46 { | 46 { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 DCHECK(scrollbarLayerImpl); | 101 DCHECK(scrollbarLayerImpl); |
| 102 DCHECK(scrollLayerImpl); | 102 DCHECK(scrollLayerImpl); |
| 103 | 103 |
| 104 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) | 104 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) |
| 105 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); | 105 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); |
| 106 else | 106 else |
| 107 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); | 107 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace cc | 110 } // namespace cc |
| OLD | NEW |