mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 1 | #ifndef DMTaskRunner_DEFINED |
2 | #define DMTaskRunner_DEFINED | ||||
3 | |||||
commit-bot@chromium.org | 787227d | 2014-03-26 21:26:15 +0000 | [diff] [blame] | 4 | #include "DMGpuSupport.h" |
mtklein | 406654b | 2014-09-03 15:34:37 -0700 | [diff] [blame] | 5 | #include "SkTDArray.h" |
6 | #include "SkTaskGroup.h" | ||||
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 7 | #include "SkTypes.h" |
8 | |||||
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 9 | namespace DM { |
10 | |||||
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 11 | class CpuTask; |
12 | class GpuTask; | ||||
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 13 | |
14 | class TaskRunner : SkNoncopyable { | ||||
15 | public: | ||||
mtklein | 406654b | 2014-09-03 15:34:37 -0700 | [diff] [blame] | 16 | TaskRunner() {} |
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 17 | |
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 18 | void add(CpuTask* task); |
19 | void add(GpuTask* task); | ||||
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 20 | void wait(); |
21 | |||||
22 | private: | ||||
mtklein | 406654b | 2014-09-03 15:34:37 -0700 | [diff] [blame] | 23 | SkTaskGroup fCpuWork; |
24 | SkTDArray<GpuTask*> fGpuWork; | ||||
mtklein@google.com | d36522d | 2013-10-16 13:02:15 +0000 | [diff] [blame] | 25 | }; |
26 | |||||
27 | } // namespace DM | ||||
28 | |||||
29 | #endif // DMTaskRunner_DEFINED |