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