| Index: src/core/SkTaskGroup.cpp
|
| diff --git a/src/core/SkTaskGroup.cpp b/src/core/SkTaskGroup.cpp
|
| index 1799256d6fe869a6d1fa58987302ecac739afdae..b3c23b649beaece214b2531a13569dc790aefd46 100644
|
| --- a/src/core/SkTaskGroup.cpp
|
| +++ b/src/core/SkTaskGroup.cpp
|
| @@ -6,7 +6,6 @@
|
| */
|
|
|
| #include "SkOnce.h"
|
| -#include "SkRunnable.h"
|
| #include "SkSemaphore.h"
|
| #include "SkSpinlock.h"
|
| #include "SkTArray.h"
|
| @@ -40,13 +39,6 @@ namespace {
|
|
|
| class ThreadPool : SkNoncopyable {
|
| public:
|
| - static void Add(SkRunnable* task, SkAtomic<int32_t>* pending) {
|
| - if (!gGlobal) { // If we have no threads, run synchronously.
|
| - return task->run();
|
| - }
|
| - gGlobal->add([task]() { task->run(); }, pending);
|
| - }
|
| -
|
| static void Add(std::function<void(void)> fn, SkAtomic<int32_t>* pending) {
|
| if (!gGlobal) {
|
| return fn();
|
| @@ -99,8 +91,6 @@ private:
|
| SkSpinlock* fLock;
|
| };
|
|
|
| - static void CallRunnable(void* arg) { static_cast<SkRunnable*>(arg)->run(); }
|
| -
|
| struct Work {
|
| std::function<void(void)> fn; // A function to call
|
| SkAtomic<int32_t>* pending; // then decrement pending afterwards.
|
| @@ -213,7 +203,6 @@ SkTaskGroup::Enabler::~Enabler() { delete ThreadPool::gGlobal; }
|
| SkTaskGroup::SkTaskGroup() : fPending(0) {}
|
|
|
| void SkTaskGroup::wait() { ThreadPool::Wait(&fPending); }
|
| -void SkTaskGroup::add(SkRunnable* task) { ThreadPool::Add(task, &fPending); }
|
| void SkTaskGroup::add(std::function<void(void)> fn) { ThreadPool::Add(fn, &fPending); }
|
| void SkTaskGroup::batch(int N, std::function<void(int)> fn) {
|
| ThreadPool::Batch(N, fn, &fPending);
|
|
|