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

Side by Side Diff: cc/CCLayerTreeHostCommon.h

Issue 11076013: [cc] Store CCLayerImpls as scoped_ptrs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
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 #ifndef CCLayerTreeHostCommon_h 5 #ifndef CCLayerTreeHostCommon_h
6 #define CCLayerTreeHostCommon_h 6 #define CCLayerTreeHostCommon_h
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "cc/own_ptr_vector.h" 9 #include "cc/scoped_ptr_vector.h"
10 #include "IntRect.h" 10 #include "IntRect.h"
11 #include "IntSize.h" 11 #include "IntSize.h"
12 #include <public/WebTransformationMatrix.h> 12 #include <public/WebTransformationMatrix.h>
13 #include <wtf/Vector.h> 13 #include <wtf/Vector.h>
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class CCLayerImpl; 17 class CCLayerImpl;
18 class CCLayerSorter; 18 class CCLayerSorter;
19 class LayerChromium; 19 class LayerChromium;
(...skipping 15 matching lines...) Expand all
35 35
36 // Returns a layer with the given id if one exists in the subtree starting 36 // Returns a layer with the given id if one exists in the subtree starting
37 // from the given root layer (including mask and replica layers). 37 // from the given root layer (including mask and replica layers).
38 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId); 38 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId);
39 39
40 static LayerChromium* getChildAsRawPtr(const std::vector<scoped_refptr<Layer Chromium> >& children, size_t index) 40 static LayerChromium* getChildAsRawPtr(const std::vector<scoped_refptr<Layer Chromium> >& children, size_t index)
41 { 41 {
42 return children[index].get(); 42 return children[index].get();
43 } 43 }
44 44
45 static CCLayerImpl* getChildAsRawPtr(const OwnPtrVector<CCLayerImpl>& childr en, size_t index) 45 static CCLayerImpl* getChildAsRawPtr(const ScopedPtrVector<CCLayerImpl>& chi ldren, size_t index)
46 { 46 {
47 return children[index]; 47 return children[index];
48 } 48 }
49 49
50 struct ScrollUpdateInfo { 50 struct ScrollUpdateInfo {
51 int layerId; 51 int layerId;
52 IntSize scrollDelta; 52 IntSize scrollDelta;
53 }; 53 };
54 }; 54 };
55 55
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 for (size_t i = 0; i < rootLayer->children().size(); ++i) { 90 for (size_t i = 0; i < rootLayer->children().size(); ++i) {
91 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId)) 91 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId))
92 return found; 92 return found;
93 } 93 }
94 return 0; 94 return 0;
95 } 95 }
96 96
97 } // namespace cc 97 } // namespace cc
98 98
99 #endif 99 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698