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

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

Issue 13296005: Revise attribute binding interface (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix fExperimentalGS in GrGLProgramDesc Created 7 years, 8 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 | « no previous file | include/gpu/GrTypesPriv.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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 sk_free(fMemArray); 105 sk_free(fMemArray);
106 } 106 }
107 } 107 }
108 108
109 /** 109 /**
110 * Resets to count() == 0 110 * Resets to count() == 0
111 */ 111 */
112 void reset() { this->pop_back_n(fCount); } 112 void reset() { this->pop_back_n(fCount); }
113 113
114 /** 114 /**
115 * Resets to a copy of a C array.
116 */
117 void reset(const T* array, int count) {
118 for (int i = 0; i < fCount; ++i) {
119 fItemArray[i].~T();
120 }
121 int delta = count - fCount;
122 this->checkRealloc(delta);
123 fCount = count;
124 for (int i = 0; i < count; ++i) {
125 SkTArrayExt::copy(this, array);
126 }
127 }
128
129 /**
115 * Number of elements in the array. 130 * Number of elements in the array.
116 */ 131 */
117 int count() const { return fCount; } 132 int count() const { return fCount; }
118 133
119 /** 134 /**
120 * Is the array empty. 135 * Is the array empty.
121 */ 136 */
122 bool empty() const { return !fCount; } 137 bool empty() const { return !fCount; }
123 138
124 /** 139 /**
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 SkSTArray& operator= (const INHERITED& array) { 448 SkSTArray& operator= (const INHERITED& array) {
434 INHERITED::operator=(array); 449 INHERITED::operator=(array);
435 return *this; 450 return *this;
436 } 451 }
437 452
438 private: 453 private:
439 SkAlignedSTStorage<N,T> fStorage; 454 SkAlignedSTStorage<N,T> fStorage;
440 }; 455 };
441 456
442 #endif 457 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698