blob: 92381a7a7ec1052d45e72f158f12c9e95e5fb623 [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#include "DMTaskRunner.h"
2#include "DMTask.h"
3
4namespace DM {
5
mtklein406654b2014-09-03 15:34:37 -07006void TaskRunner::add(CpuTask* task) { fCpuWork.add(task); }
7void TaskRunner::add(GpuTask* task) { fGpuWork.push(task); }
mtklein@google.comd36522d2013-10-16 13:02:15 +00008
9void TaskRunner::wait() {
mtklein406654b2014-09-03 15:34:37 -070010 GrContextFactory factory;
11 for (int i = 0; i < fGpuWork.count(); i++) {
12 fGpuWork[i]->run(&factory);
13 }
14 fCpuWork.wait();
mtklein@google.comd36522d2013-10-16 13:02:15 +000015}
16
17} // namespace DM