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

Side by Side Diff: cc/scoped_ptr_vector.h

Issue 11704002: cc: Generate tilings at other scales for impl-side painting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, sort() 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/picture_layer_tiling_set_unittest.cc ('k') | cc/tile.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 CC_SCOPED_PTR_VECTOR_H_ 5 #ifndef CC_SCOPED_PTR_VECTOR_H_
6 #define CC_SCOPED_PTR_VECTOR_H_ 6 #define CC_SCOPED_PTR_VECTOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void swap(iterator a, iterator b) { 132 void swap(iterator a, iterator b) {
133 DCHECK(a < end()); 133 DCHECK(a < end());
134 DCHECK(b < end()); 134 DCHECK(b < end());
135 if (a == end() || b == end() || a == b) 135 if (a == end() || b == end() || a == b)
136 return; 136 return;
137 typename std::vector<T*>::iterator writable_a = a; 137 typename std::vector<T*>::iterator writable_a = a;
138 typename std::vector<T*>::iterator writable_b = b; 138 typename std::vector<T*>::iterator writable_b = b;
139 std::swap(*writable_a, *writable_b); 139 std::swap(*writable_a, *writable_b);
140 } 140 }
141 141
142 template<class Compare>
143 inline void sort(Compare comp) {
144 std::sort(data_.begin(), data_.end(), comp);
145 }
146
142 iterator begin() { return static_cast<iterator>(data_.begin()); } 147 iterator begin() { return static_cast<iterator>(data_.begin()); }
143 const_iterator begin() const { return data_.begin(); } 148 const_iterator begin() const { return data_.begin(); }
144 iterator end() { return static_cast<iterator>(data_.end()); } 149 iterator end() { return static_cast<iterator>(data_.end()); }
145 const_iterator end() const { return data_.end(); } 150 const_iterator end() const { return data_.end(); }
146 151
147 reverse_iterator rbegin() { return data_.rbegin(); } 152 reverse_iterator rbegin() { return data_.rbegin(); }
148 const_reverse_iterator rbegin() const { return data_.rbegin(); } 153 const_reverse_iterator rbegin() const { return data_.rbegin(); }
149 reverse_iterator rend() { return data_.rend(); } 154 reverse_iterator rend() { return data_.rend(); }
150 const_reverse_iterator rend() const { return data_.rend(); } 155 const_reverse_iterator rend() const { return data_.rend(); }
151 156
152 private: 157 private:
153 std::vector<T*> data_; 158 std::vector<T*> data_;
154 159
155 DISALLOW_COPY_AND_ASSIGN(ScopedPtrVector); 160 DISALLOW_COPY_AND_ASSIGN(ScopedPtrVector);
156 }; 161 };
157 162
158 } // namespace cc 163 } // namespace cc
159 164
160 #endif // CC_SCOPED_PTR_VECTOR_H_ 165 #endif // CC_SCOPED_PTR_VECTOR_H_
OLDNEW
« no previous file with comments | « cc/picture_layer_tiling_set_unittest.cc ('k') | cc/tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698