diff options
Diffstat (limited to 'chromium/third_party/skia/dm/DMTaskRunner.h')
-rw-r--r-- | chromium/third_party/skia/dm/DMTaskRunner.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/third_party/skia/dm/DMTaskRunner.h b/chromium/third_party/skia/dm/DMTaskRunner.h new file mode 100644 index 00000000000..dd1440ed9ac --- /dev/null +++ b/chromium/third_party/skia/dm/DMTaskRunner.h @@ -0,0 +1,32 @@ +#ifndef DMTaskRunner_DEFINED +#define DMTaskRunner_DEFINED + +#include "DMGpuSupport.h" +#include "SkThreadPool.h" +#include "SkTypes.h" + +// TaskRunner runs Tasks on one of two threadpools depending on the need for a GrContextFactory. +// It's typically a good idea to run fewer GPU threads than CPU threads (go nuts with those). + +namespace DM { + +class CpuTask; +class GpuTask; + +class TaskRunner : SkNoncopyable { +public: + explicit TaskRunner(int cpuThreads, int gpuThreads); + + void add(CpuTask* task); + void addNext(CpuTask* task); + void add(GpuTask* task); + void wait(); + +private: + SkTThreadPool<void> fCpu; + SkTThreadPool<GrContextFactory> fGpu; +}; + +} // namespace DM + +#endif // DMTaskRunner_DEFINED |