Index: src/utils/SkTaskGroup.h |
diff --git a/src/utils/SkTaskGroup.h b/src/utils/SkTaskGroup.h |
index c60ceda52e01d5bc7b6c246bcaf3bc1a4c3caecb..d959d94c33386844bc119d58e4a011e007f91f4d 100644 |
--- a/src/utils/SkTaskGroup.h |
+++ b/src/utils/SkTaskGroup.h |
@@ -27,11 +27,18 @@ public: |
void add(SkRunnable*); |
void add(void (*fn)(void*), void* arg); |
+ // Add a batch of N tasks, all calling fn with different arguments. |
+ // Equivalent to a loop over add(fn, arg), but with perhaps less synchronization overhead. |
+ template <typename T> |
+ void batch(void (*fn)(void*), T* args, int N) { this->batch(fn, args, N, sizeof(T)); } |
reed1
2014/10/29 19:57:30
1. Slightly odd to me that we don't expose the non
mtklein
2014/10/29 20:01:00
Yeah. Just seemed like the template version makes
|
+ |
// Block until all Tasks previously add()ed to this SkTaskGroup have run. |
// You may safely reuse this SkTaskGroup after wait() returns. |
void wait(); |
private: |
+ void batch(void (*fn)(void*), void* args, int N, size_t stride); |
+ |
/*atomic*/ int32_t fPending; |
}; |