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

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: Add DCHECK Created 8 years, 1 month 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
« cc/scoped_ptr_vector.h ('K') | « cc/texture_uploader.cc ('k') | no next file » | 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 "cc/layer.h" 7 #include "cc/layer.h"
8 #include "cc/layer_impl.h" 8 #include "cc/layer_impl.h"
9 #include "cc/scrollbar_animation_controller.h" 9 #include "cc/scrollbar_animation_controller.h"
10 #include "cc/scrollbar_layer.h" 10 #include "cc/scrollbar_layer.h"
(...skipping 14 matching lines...) Expand all
25 25
26 return newTree.Pass(); 26 return newTree.Pass();
27 } 27 }
28 28
29 void TreeSynchronizer::collectExistingLayerImplRecursive(ScopedPtrLayerImplMap& oldLayers, scoped_ptr<LayerImpl> layerImpl) 29 void TreeSynchronizer::collectExistingLayerImplRecursive(ScopedPtrLayerImplMap& oldLayers, scoped_ptr<LayerImpl> layerImpl)
30 { 30 {
31 if (!layerImpl) 31 if (!layerImpl)
32 return; 32 return;
33 33
34 ScopedPtrVector<LayerImpl>& children = layerImpl->m_children; 34 ScopedPtrVector<LayerImpl>& children = layerImpl->m_children;
35 for (size_t i = 0; i < children.size(); ++i) 35 for (ScopedPtrVector<LayerImpl>::iterator it = children.begin(); it != child ren.end(); ++it)
36 collectExistingLayerImplRecursive(oldLayers, children.take(i)); 36 collectExistingLayerImplRecursive(oldLayers, children.take(it));
37 37
38 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_maskLayer.Pass()); 38 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_maskLayer.Pass());
39 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_replicaLayer.Pass( )); 39 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_replicaLayer.Pass( ));
40 40
41 int id = layerImpl->id(); 41 int id = layerImpl->id();
42 oldLayers.set(id, layerImpl.Pass()); 42 oldLayers.set(id, layerImpl.Pass());
43 } 43 }
44 44
45 scoped_ptr<LayerImpl> TreeSynchronizer::reuseOrCreateLayerImpl(RawPtrLayerImplMa p& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer) 45 scoped_ptr<LayerImpl> TreeSynchronizer::reuseOrCreateLayerImpl(RawPtrLayerImplMa p& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer)
46 { 46 {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 DCHECK(scrollbarLayerImpl); 101 DCHECK(scrollbarLayerImpl);
102 DCHECK(scrollLayerImpl); 102 DCHECK(scrollLayerImpl);
103 103
104 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) 104 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal)
105 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); 105 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl);
106 else 106 else
107 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); 107 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl);
108 } 108 }
109 109
110 } // namespace cc 110 } // namespace cc
OLDNEW
« cc/scoped_ptr_vector.h ('K') | « cc/texture_uploader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698