blob: 3d4e491b9cb298becb4a30a40462cca1b23f28ac [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#ifndef DMTaskRunner_DEFINED
2#define DMTaskRunner_DEFINED
3
commit-bot@chromium.org787227d2014-03-26 21:26:15 +00004#include "DMGpuSupport.h"
mtklein406654b2014-09-03 15:34:37 -07005#include "SkTDArray.h"
6#include "SkTaskGroup.h"
mtklein@google.comd36522d2013-10-16 13:02:15 +00007#include "SkTypes.h"
8
mtklein@google.comd36522d2013-10-16 13:02:15 +00009namespace DM {
10
commit-bot@chromium.orgef57b7e2014-02-28 20:31:31 +000011class CpuTask;
12class GpuTask;
mtklein@google.comd36522d2013-10-16 13:02:15 +000013
14class TaskRunner : SkNoncopyable {
15public:
mtklein406654b2014-09-03 15:34:37 -070016 TaskRunner() {}
mtklein@google.comd36522d2013-10-16 13:02:15 +000017
commit-bot@chromium.orgef57b7e2014-02-28 20:31:31 +000018 void add(CpuTask* task);
19 void add(GpuTask* task);
mtklein@google.comd36522d2013-10-16 13:02:15 +000020 void wait();
21
22private:
mtklein406654b2014-09-03 15:34:37 -070023 SkTaskGroup fCpuWork;
24 SkTDArray<GpuTask*> fGpuWork;
mtklein@google.comd36522d2013-10-16 13:02:15 +000025};
26
27} // namespace DM
28
29#endif // DMTaskRunner_DEFINED