e4d3e605f7
Removed expectations code for PDF backend for now, given that we don't have any, and refactored a little to make that cleaner. We can now test .skp -> .pdf -> .png in DM. Neat eh? BUG=skia:2598 R=halcanary@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/316643003
24 lines
791 B
C++
24 lines
791 B
C++
#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
|