Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: cc/tree_synchronizer.cc

Issue 11583009: cc: Refactor shared code in tree sync unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/tree_synchronizer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698