Index: src/core/SkTaskGroup.cpp |
diff --git a/src/core/SkTaskGroup.cpp b/src/core/SkTaskGroup.cpp |
index 97e3ff44a8518daf99a826a2b9650ac407d5971b..863195cfd3feea11c8db574ddd7e917d90130c5e 100644 |
--- a/src/core/SkTaskGroup.cpp |
+++ b/src/core/SkTaskGroup.cpp |
@@ -196,6 +196,7 @@ private: |
static ThreadPool* gGlobal; |
friend struct SkTaskGroup::Enabler; |
+ friend int ::sk_parallel_for_thread_count(); |
}; |
ThreadPool* ThreadPool::gGlobal = nullptr; |
@@ -219,3 +220,9 @@ void SkTaskGroup::batch (void (*fn)(void*), void* args, int N, size_t stride) { |
ThreadPool::Batch(fn, args, N, stride, &fPending); |
} |
+int sk_parallel_for_thread_count() { |
+ if (ThreadPool::gGlobal != nullptr) { |
+ return ThreadPool::gGlobal->fThreads.count(); |
+ } |
+ return 0; |
+} |