OLD | NEW |
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 "SkThreadPool.h" |
6 #include "SkTypes.h" | 6 #include "SkTypes.h" |
7 | 7 |
8 // TaskRunner runs Tasks on one of two threadpools depending on the need for a G
rContextFactory. | 8 // 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). | 9 // It's typically a good idea to run fewer GPU threads than CPU threads (go nuts
with those). |
10 | 10 |
11 namespace DM { | 11 namespace DM { |
12 | 12 |
13 class CpuTask; | 13 class CpuTask; |
14 class GpuTask; | 14 class GpuTask; |
15 | 15 |
16 class TaskRunner : SkNoncopyable { | 16 class TaskRunner : SkNoncopyable { |
17 public: | 17 public: |
18 explicit TaskRunner(int cpuThreads, int gpuThreads); | 18 explicit TaskRunner(int cpuThreads, int gpuThreads); |
19 | 19 |
20 void add(CpuTask* task); | 20 void add(CpuTask* task); |
| 21 void addNext(CpuTask* task); |
21 void add(GpuTask* task); | 22 void add(GpuTask* task); |
22 void wait(); | 23 void wait(); |
23 | 24 |
24 private: | 25 private: |
25 SkTThreadPool<void> fCpu; | 26 SkTThreadPool<void> fCpu; |
26 SkTThreadPool<GrContextFactory> fGpu; | 27 SkTThreadPool<GrContextFactory> fGpu; |
27 }; | 28 }; |
28 | 29 |
29 } // namespace DM | 30 } // namespace DM |
30 | 31 |
31 #endif // DMTaskRunner_DEFINED | 32 #endif // DMTaskRunner_DEFINED |
OLD | NEW |