aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-01 19:12:42 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-01 19:12:42 +0000
commitfb495b537f5ddd6966f02cfe38f6b106a4869934 (patch)
tree1e8569d2cb179353d07e3f96a240909000502c67 /include/core
parentd9c1853fb88ef02f74d003a5abd5531315a726db (diff)
Revise attribute binding interface.
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@8466 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; }