Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: dm/DMTaskRunner.h

Issue 533393002: Revert of SkThreadPool ~~> SkTaskGroup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMTask.cpp ('k') | dm/DMTaskRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMTaskRunner.h
diff --git a/dm/DMTaskRunner.h b/dm/DMTaskRunner.h
index d147525380ed5086ade310cfbb8ec0fd14c5c4ca..dd1440ed9accb50740ae56193b5045da7bf8582f 100644
--- a/dm/DMTaskRunner.h
+++ b/dm/DMTaskRunner.h
@@ -2,12 +2,11 @@
#define DMTaskRunner_DEFINED
#include "DMGpuSupport.h"
-#include "SkTDArray.h"
-#include "SkTaskGroup.h"
+#include "SkThreadPool.h"
#include "SkTypes.h"
// TaskRunner runs Tasks on one of two threadpools depending on the need for a GrContextFactory.
-// We fix the number of GPU threads to 1, but go nuts with CPU threads.
+// It's typically a good idea to run fewer GPU threads than CPU threads (go nuts with those).
namespace DM {
@@ -16,16 +15,16 @@
class TaskRunner : SkNoncopyable {
public:
- // 0 -> one thread per core
- explicit TaskRunner(int cpuThreads);
+ explicit TaskRunner(int cpuThreads, int gpuThreads);
void add(CpuTask* task);
+ void addNext(CpuTask* task);
void add(GpuTask* task);
void wait();
private:
- SkTaskGroup fCpuWork;
- SkTDArray<GpuTask*> fGpuWork;
+ SkTThreadPool<void> fCpu;
+ SkTThreadPool<GrContextFactory> fGpu;
};
} // namespace DM
« no previous file with comments | « dm/DMTask.cpp ('k') | dm/DMTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698