OLD | NEW |
---|---|
(Empty) | |
1 #ifndef DMTaskRunner_DEFINED | |
2 #define DMTaskRunner_DEFINED | |
3 | |
4 #include "SkTemplates.h" | |
5 #include "SkThreadPool.h" | |
6 #include "SkTypes.h" | |
7 | |
8 // TaskRunner runs Tasks on one of two threadpools depending on the Task's usesG pu() method. | |
9 // This lets us drive the GPU with a small number of threads (e.g. 2 or 4 can be faster than 1) | |
10 // while not swamping it with requests from the full fleet of threads that CPU-b ound tasks run on. | |
11 | |
12 namespace DM { | |
13 | |
14 class Task; | |
15 | |
16 class TaskRunner : SkNoncopyable { | |
17 public: | |
18 TaskRunner(int cputhreads, int gpuThreads); | |
19 | |
20 void add(Task* task); | |
21 void wait(); | |
22 | |
23 private: | |
24 SkAutoTDelete<SkThreadPool> fMain, fGpu; | |
scroggo
2013/10/11 21:20:48
Now that you've added wait() to SkThreadPool, you
mtklein
2013/10/15 18:30:53
Absolutely. Done.
| |
25 }; | |
26 | |
27 } // namespace DM | |
28 | |
29 #endif // DMTaskRunner_DEFINED | |
OLD | NEW |