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