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" |
11 #include "cc/scrollbar_layer.h" | 11 #include "cc/scrollbar_layer.h" |
12 #include "cc/scrollbar_layer_impl.h" | 12 #include "cc/scrollbar_layer_impl.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 scoped_ptr<LayerImpl> TreeSynchronizer::synchronizeTrees(Layer* layerRoot, scope
d_ptr<LayerImpl> oldLayerImplRoot, LayerTreeImpl* treeImpl) | 16 scoped_ptr<LayerImpl> TreeSynchronizer::synchronizeTrees(Layer* layerRoot, scope
d_ptr<LayerImpl> oldLayerImplRoot, LayerTreeImpl* treeImpl) |
17 { | 17 { |
| 18 DCHECK(treeImpl); |
| 19 |
18 TRACE_EVENT0("cc", "TreeSynchronizer::synchronizeTrees"); | 20 TRACE_EVENT0("cc", "TreeSynchronizer::synchronizeTrees"); |
19 ScopedPtrLayerImplMap oldLayers; | 21 ScopedPtrLayerImplMap oldLayers; |
20 RawPtrLayerImplMap newLayers; | 22 RawPtrLayerImplMap newLayers; |
21 | 23 |
22 collectExistingLayerImplRecursive(oldLayers, oldLayerImplRoot.Pass()); | 24 collectExistingLayerImplRecursive(oldLayers, oldLayerImplRoot.Pass()); |
23 | 25 |
24 scoped_ptr<LayerImpl> newTree = synchronizeTreeRecursive(newLayers, oldLayer
s, layerRoot, treeImpl); | 26 scoped_ptr<LayerImpl> newTree = synchronizeTreeRecursive(newLayers, oldLayer
s, layerRoot, treeImpl); |
25 | 27 |
26 updateScrollbarLayerPointersRecursive(newLayers, layerRoot); | 28 updateScrollbarLayerPointersRecursive(newLayers, layerRoot); |
27 | 29 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 DCHECK(scrollbarLayerImpl); | 104 DCHECK(scrollbarLayerImpl); |
103 DCHECK(scrollLayerImpl); | 105 DCHECK(scrollLayerImpl); |
104 | 106 |
105 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) | 107 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) |
106 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); | 108 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); |
107 else | 109 else |
108 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); | 110 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); |
109 } | 111 } |
110 | 112 |
111 } // namespace cc | 113 } // namespace cc |
OLD | NEW |