commit-bot@chromium.org | 90b5a2a | 2014-05-14 17:55:32 +0000 | [diff] [blame] | 1 | #include "DMRecordTask.h" |
| 2 | #include "DMSKPTask.h" |
| 3 | #include "DMUtil.h" |
| 4 | #include "DMWriteTask.h" |
| 5 | |
| 6 | namespace DM { |
| 7 | |
commit-bot@chromium.org | d6dcacd | 2014-05-14 20:26:00 +0000 | [diff] [blame] | 8 | SKPTask::SKPTask(Reporter* r, TaskRunner* tr, SkPicture* pic, SkString filename) |
mtklein | e4d3e60 | 2014-06-06 09:28:43 -0700 | [diff] [blame] | 9 | : CpuTask(r, tr), fPicture(SkRef(pic)), fName(FileToTaskName(filename)) {} |
commit-bot@chromium.org | 90b5a2a | 2014-05-14 17:55:32 +0000 | [diff] [blame] | 10 | |
| 11 | void SKPTask::draw() { |
| 12 | SkBitmap bitmap; |
commit-bot@chromium.org | 2664207 | 2014-05-15 17:33:31 +0000 | [diff] [blame] | 13 | AllocatePixels(kN32_SkColorType, fPicture->width(), fPicture->height(), &bitmap); |
commit-bot@chromium.org | 90b5a2a | 2014-05-14 17:55:32 +0000 | [diff] [blame] | 14 | DrawPicture(fPicture, &bitmap); |
| 15 | |
| 16 | this->spawnChild(SkNEW_ARGS(RecordTask, |
| 17 | (*this, fPicture, bitmap, RecordTask::kNoOptimize_Mode))); |
| 18 | this->spawnChild(SkNEW_ARGS(RecordTask, |
| 19 | (*this, fPicture, bitmap, RecordTask::kOptimize_Mode))); |
commit-bot@chromium.org | d6dcacd | 2014-05-14 20:26:00 +0000 | [diff] [blame] | 20 | this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
commit-bot@chromium.org | 90b5a2a | 2014-05-14 17:55:32 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | } // namespace DM |