void CpuGMTask::draw() { SkBitmap bitmap; AllocatePixels(fColorType, fGM->getISize().width(), fGM->getISize().height(), &bitmap); SkCanvas canvas(bitmap); canvas.concat(fGM->getInitialTransform()); fGM->draw(&canvas); canvas.flush(); #define SPAWN(ChildTask, ...) this->spawnChild(SkNEW_ARGS(ChildTask, (*this, __VA_ARGS__))) SPAWN(ExpectationsTask, fExpectations, bitmap); SPAWN(PipeTask, fGMFactory(NULL), bitmap, PipeTask::kInProcess_Mode); SPAWN(PipeTask, fGMFactory(NULL), bitmap, PipeTask::kCrossProcess_Mode); SPAWN(PipeTask, fGMFactory(NULL), bitmap, PipeTask::kSharedAddress_Mode); SPAWN(QuiltTask, fGMFactory(NULL), bitmap); SPAWN(RecordTask, fGMFactory(NULL), bitmap, RecordTask::kOptimize_Mode); SPAWN(RecordTask, fGMFactory(NULL), bitmap, RecordTask::kNoOptimize_Mode); SPAWN(ReplayTask, fGMFactory(NULL), bitmap, ReplayTask::kNormal_Mode); SPAWN(ReplayTask, fGMFactory(NULL), bitmap, ReplayTask::kRTree_Mode); SPAWN(SerializeTask, fGMFactory(NULL), bitmap); SPAWN(WriteTask, bitmap); #undef SPAWN }
CpuGMTask::CpuGMTask(const char* config, Reporter* reporter, TaskRunner* taskRunner, skiagm::GMRegistry::Factory gmFactory, const Expectations& expectations, SkColorType colorType) : CpuTask(reporter, taskRunner) , fGMFactory(gmFactory) , fGM(fGMFactory(NULL)) , fName(UnderJoin(fGM->getName(), config)) , fExpectations(expectations) , fColorType(colorType) {}
CpuTask::CpuTask(const char* name, Reporter* reporter, TaskRunner* taskRunner, const Expectations& expectations, skiagm::GMRegistry::Factory gmFactory, SkBitmap::Config config) : Task(reporter, taskRunner) , fGMFactory(gmFactory) , fGM(fGMFactory(NULL)) , fName(UnderJoin(fGM->shortName(), name)) , fExpectations(expectations) , fConfig(config) {}
void CpuGMTask::draw() { SkBitmap bitmap; SetupBitmap(fColorType, fGM.get(), &bitmap); SkCanvas canvas(bitmap); canvas.concat(fGM->getInitialTransform()); fGM->draw(&canvas); canvas.flush(); #define SPAWN(ChildTask, ...) this->spawnChild(SkNEW_ARGS(ChildTask, (*this, __VA_ARGS__))) SPAWN(ExpectationsTask, fExpectations, bitmap); SPAWN(PipeTask, fGMFactory(NULL), bitmap, false, false); SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, false); SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, true); SPAWN(QuiltTask, fGMFactory(NULL), bitmap); SPAWN(RecordTask, fGMFactory(NULL), bitmap); SPAWN(ReplayTask, fGMFactory(NULL), bitmap, false); SPAWN(ReplayTask, fGMFactory(NULL), bitmap, true); SPAWN(SerializeTask, fGMFactory(NULL), bitmap); SPAWN(WriteTask, bitmap); #undef SPAWN }