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

Side by Side Diff: include/private/SkTArray.h

Issue 2255683004: Revert of Batched implementation of drawLattice() for GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/core/SkLatticeIter.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 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkTArray_DEFINED 8 #ifndef SkTArray_DEFINED
9 #define SkTArray_DEFINED 9 #define SkTArray_DEFINED
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 * to separate T values. 228 * to separate T values.
229 */ 229 */
230 T* push_back_n(int n, const T t[]) { 230 T* push_back_n(int n, const T t[]) {
231 SkASSERT(n >= 0); 231 SkASSERT(n >= 0);
232 this->checkRealloc(n); 232 this->checkRealloc(n);
233 for (int i = 0; i < n; ++i) { 233 for (int i = 0; i < n; ++i) {
234 new (fItemArray + fCount + i) T(t[i]); 234 new (fItemArray + fCount + i) T(t[i]);
235 } 235 }
236 fCount += n; 236 fCount += n;
237 return fItemArray + fCount - n; 237 return fItemArray + fCount - n;
238 }
239
240 /**
241 * Version of above that uses the move constructor to set n items.
242 */
243 T* move_back_n(int n, T* t) {
244 SkASSERT(n >= 0);
245 this->checkRealloc(n);
246 for (int i = 0; i < n; ++i) {
247 new (fItemArray + fCount + i) T(std::move(t[i]));
248 }
249 fCount += n;
250 return fItemArray + fCount - n;
251 } 238 }
252 239
253 /** 240 /**
254 * Removes the last element. Not safe to call when count() == 0. 241 * Removes the last element. Not safe to call when count() == 0.
255 */ 242 */
256 void pop_back() { 243 void pop_back() {
257 SkASSERT(fCount > 0); 244 SkASSERT(fCount > 0);
258 --fCount; 245 --fCount;
259 fItemArray[fCount].~T(); 246 fItemArray[fCount].~T();
260 this->checkRealloc(0); 247 this->checkRealloc(0);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 SkSTArray& operator= (const INHERITED& array) { 538 SkSTArray& operator= (const INHERITED& array) {
552 INHERITED::operator=(array); 539 INHERITED::operator=(array);
553 return *this; 540 return *this;
554 } 541 }
555 542
556 private: 543 private:
557 SkAlignedSTStorage<N,T> fStorage; 544 SkAlignedSTStorage<N,T> fStorage;
558 }; 545 };
559 546
560 #endif 547 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/core/SkLatticeIter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698