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