diff options
Diffstat (limited to 'chromium/third_party/skia/dm/DMSKPTask.cpp')
-rw-r--r-- | chromium/third_party/skia/dm/DMSKPTask.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chromium/third_party/skia/dm/DMSKPTask.cpp b/chromium/third_party/skia/dm/DMSKPTask.cpp new file mode 100644 index 00000000000..760138f7c98 --- /dev/null +++ b/chromium/third_party/skia/dm/DMSKPTask.cpp @@ -0,0 +1,23 @@ +#include "DMRecordTask.h" +#include "DMSKPTask.h" +#include "DMUtil.h" +#include "DMWriteTask.h" + +namespace DM { + +SKPTask::SKPTask(Reporter* r, TaskRunner* tr, SkPicture* pic, SkString filename) + : CpuTask(r, tr), fPicture(SkRef(pic)), fName(FileToTaskName(filename)) {} + +void SKPTask::draw() { + SkBitmap bitmap; + AllocatePixels(kN32_SkColorType, fPicture->width(), fPicture->height(), &bitmap); + DrawPicture(fPicture, &bitmap); + + this->spawnChild(SkNEW_ARGS(RecordTask, + (*this, fPicture, bitmap, RecordTask::kNoOptimize_Mode))); + this->spawnChild(SkNEW_ARGS(RecordTask, + (*this, fPicture, bitmap, RecordTask::kOptimize_Mode))); + this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); +} + +} // namespace DM |