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

Side by Side Diff: cc/tree_synchronizer.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android!! Created 7 years, 11 months 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 | « cc/tile_manager.cc ('k') | content/common/cc_messages.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"
(...skipping 18 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « cc/tile_manager.cc ('k') | content/common/cc_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698