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

Side by Side Diff: cc/TreeSynchronizer.cpp

Issue 10940002: Add wrapper container for a vector of OwnPtr<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/ScrollbarLayerChromiumTest.cpp ('k') | cc/TreeSynchronizerTest.cpp » ('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 "config.h" 5 #include "config.h"
6 6
7 #include "TreeSynchronizer.h" 7 #include "TreeSynchronizer.h"
8 8
9 #include "CCLayerImpl.h" 9 #include "CCLayerImpl.h"
10 #include "CCScrollbarAnimationController.h" 10 #include "CCScrollbarAnimationController.h"
(...skipping 18 matching lines...) Expand all
29 return newTree.release(); 29 return newTree.release();
30 } 30 }
31 31
32 void TreeSynchronizer::collectExistingCCLayerImplRecursive(OwnPtrCCLayerImplMap& oldLayers, PassOwnPtr<CCLayerImpl> popCCLayerImpl) 32 void TreeSynchronizer::collectExistingCCLayerImplRecursive(OwnPtrCCLayerImplMap& oldLayers, PassOwnPtr<CCLayerImpl> popCCLayerImpl)
33 { 33 {
34 OwnPtr<CCLayerImpl> ccLayerImpl = popCCLayerImpl; 34 OwnPtr<CCLayerImpl> ccLayerImpl = popCCLayerImpl;
35 35
36 if (!ccLayerImpl) 36 if (!ccLayerImpl)
37 return; 37 return;
38 38
39 Vector<OwnPtr<CCLayerImpl> >& children = ccLayerImpl->m_children; 39 OwnPtrVector<CCLayerImpl>& children = ccLayerImpl->m_children;
40 for (size_t i = 0; i < children.size(); ++i) 40 for (size_t i = 0; i < children.size(); ++i)
41 collectExistingCCLayerImplRecursive(oldLayers, children[i].release()); 41 collectExistingCCLayerImplRecursive(oldLayers, children.take(i));
42 42
43 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_maskLayer.rele ase()); 43 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_maskLayer.rele ase());
44 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_replicaLayer.r elease()); 44 collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_replicaLayer.r elease());
45 45
46 int id = ccLayerImpl->id(); 46 int id = ccLayerImpl->id();
47 oldLayers.set(id, ccLayerImpl.release()); 47 oldLayers.set(id, ccLayerImpl.release());
48 } 48 }
49 49
50 PassOwnPtr<CCLayerImpl> TreeSynchronizer::reuseOrCreateCCLayerImpl(RawPtrCCLayer ImplMap& newLayers, OwnPtrCCLayerImplMap& oldLayers, LayerChromium* layer) 50 PassOwnPtr<CCLayerImpl> TreeSynchronizer::reuseOrCreateCCLayerImpl(RawPtrCCLayer ImplMap& newLayers, OwnPtrCCLayerImplMap& oldLayers, LayerChromium* layer)
51 { 51 {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 CCLayerImpl* ccScrollLayerImpl = newLayers.get(scrollbarLayer->scrollLayerId ()); 103 CCLayerImpl* ccScrollLayerImpl = newLayers.get(scrollbarLayer->scrollLayerId ());
104 ASSERT(ccScrollLayerImpl); 104 ASSERT(ccScrollLayerImpl);
105 105
106 if (ccScrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) 106 if (ccScrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal)
107 ccScrollLayerImpl->setHorizontalScrollbarLayer(ccScrollbarLayerImpl); 107 ccScrollLayerImpl->setHorizontalScrollbarLayer(ccScrollbarLayerImpl);
108 else 108 else
109 ccScrollLayerImpl->setVerticalScrollbarLayer(ccScrollbarLayerImpl); 109 ccScrollLayerImpl->setVerticalScrollbarLayer(ccScrollbarLayerImpl);
110 } 110 }
111 111
112 } // namespace cc 112 } // namespace cc
OLDNEW
« no previous file with comments | « cc/ScrollbarLayerChromiumTest.cpp ('k') | cc/TreeSynchronizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698