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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTArray.h
===================================================================
--- include/core/SkTArray.h (revision 8462)
+++ include/core/SkTArray.h (working copy)
@@ -112,6 +112,21 @@
void reset() { this->pop_back_n(fCount); }
/**
+ * Resets to a copy of a C array.
+ */
+ void reset(const T* array, int count) {
+ for (int i = 0; i < fCount; ++i) {
+ fItemArray[i].~T();
+ }
+ int delta = count - fCount;
+ this->checkRealloc(delta);
+ fCount = count;
+ for (int i = 0; i < count; ++i) {
+ SkTArrayExt::copy(this, array);
+ }
+ }
+
+ /**
* Number of elements in the array.
*/
int count() const { return fCount; }
« 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