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

Side by Side Diff: dm/DMTaskRunner.h

Issue 531653002: SkThreadPool ~~> SkTaskGroup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup allowThreaded() 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 unified diff | Download patch
OLDNEW
1 #ifndef DMTaskRunner_DEFINED 1 #ifndef DMTaskRunner_DEFINED
2 #define DMTaskRunner_DEFINED 2 #define DMTaskRunner_DEFINED
3 3
4 #include "DMGpuSupport.h" 4 #include "DMGpuSupport.h"
5 #include "SkThreadPool.h" 5 #include "SkTDArray.h"
6 #include "SkTaskGroup.h"
6 #include "SkTypes.h" 7 #include "SkTypes.h"
7 8
8 // TaskRunner runs Tasks on one of two threadpools depending on the need for a G rContextFactory. 9 // TaskRunner runs Tasks on one of two threadpools depending on the need for a G rContextFactory.
9 // It's typically a good idea to run fewer GPU threads than CPU threads (go nuts with those). 10 // We fix the number of GPU threads to 1, but go nuts with CPU threads.
10 11
11 namespace DM { 12 namespace DM {
12 13
13 class CpuTask; 14 class CpuTask;
14 class GpuTask; 15 class GpuTask;
15 16
16 class TaskRunner : SkNoncopyable { 17 class TaskRunner : SkNoncopyable {
17 public: 18 public:
18 explicit TaskRunner(int cpuThreads, int gpuThreads); 19 // 0 -> one thread per core
20 explicit TaskRunner(int cpuThreads);
19 21
20 void add(CpuTask* task); 22 void add(CpuTask* task);
21 void addNext(CpuTask* task);
22 void add(GpuTask* task); 23 void add(GpuTask* task);
23 void wait(); 24 void wait();
24 25
25 private: 26 private:
26 SkTThreadPool<void> fCpu; 27 SkTaskGroup fCpuWork;
27 SkTThreadPool<GrContextFactory> fGpu; 28 SkTDArray<GpuTask*> fGpuWork;
28 }; 29 };
29 30
30 } // namespace DM 31 } // namespace DM
31 32
32 #endif // DMTaskRunner_DEFINED 33 #endif // DMTaskRunner_DEFINED
OLDNEW
« no previous file with comments | « dm/DMTask.cpp ('k') | dm/DMTaskRunner.cpp » ('j') | src/utils/SkRunnable.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698