aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-01 20:06:51 +0000
committerGravatar jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-01 20:06:51 +0000
commit054ae99d93711c26e40682a0e3a03a47ea605c53 (patch)
tree9769952514a25fe77774f14fecd311d52c3ac068 /include/core
parentc7bf2963f00a29bd28e5e2a446da79f93c1d9383 (diff)
Take two for r8466:
Replace the old attribute binding and index interface with one where we include the binding as part of the attribute array. Also removed the fixed attribute indices for constant color and coverage attributes, and replaced with dynamic ones based on current attribute set. Removed binding of color and coverage attributes unless they're actually set. Original author: bsalomon@google.com Author: jvanverth@google.com Reviewed By: bsalomon@google.com,robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/13296005 git-svn-id: http://skia.googlecode.com/svn/trunk@8468 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkTArray.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h
index 45808d4b60..bb5e57eada 100644
--- a/include/core/SkTArray.h
+++ b/include/core/SkTArray.h
@@ -112,6 +112,21 @@ public:
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; }