Index: dm/DMTaskRunner.cpp |
diff --git a/dm/DMTaskRunner.cpp b/dm/DMTaskRunner.cpp |
index bd53ce615a61134271a1751add333c4eec480ff6..22269a4d7046739a1689d1b08d33987f3ddafcc6 100644 |
--- a/dm/DMTaskRunner.cpp |
+++ b/dm/DMTaskRunner.cpp |
@@ -3,21 +3,10 @@ |
namespace DM { |
- |
-TaskRunner::TaskRunner(int cputhreads) |
+TaskRunner::TaskRunner(int cputhreads, int gpuThreads) |
: fMain(cputhreads) |
- , fGpu(1) { |
- // Enqueue a task on the GPU thread to create a GrContextFactory. |
- struct Create : public SkRunnable { |
- Create(GrContextFactory** ptr) : fPtr(ptr) {} |
- void run() SK_OVERRIDE { |
- *fPtr = SkNEW(GrContextFactory); |
- delete this; |
- } |
- GrContextFactory** fPtr; |
- }; |
- fGpu.add(SkNEW_ARGS(Create, (&fGrContextFactory))); |
-} |
+ , fGpu(gpuThreads) |
+ {} |
void TaskRunner::add(Task* task) { |
if (task->usesGpu()) { |
@@ -28,17 +17,6 @@ |
} |
void TaskRunner::wait() { |
- // Enqueue a task on the GPU thread to destroy the GrContextFactory. |
- struct Delete : public SkRunnable { |
- Delete(GrContextFactory* ptr) : fPtr(ptr) {} |
- void run() SK_OVERRIDE { |
- delete fPtr; |
- delete this; |
- } |
- GrContextFactory* fPtr; |
- }; |
- fGpu.add(SkNEW_ARGS(Delete, (fGrContextFactory))); |
- |
// These wait calls block until the threadpool is done. We don't allow |
// children to spawn new GPU tasks so we can wait for that first knowing |
// we'll never try to add to it later. Same can't be said of fMain: fGpu |