skia2/dm/DMSKPTask.cpp
commit-bot@chromium.org 90b5a2a653 DM: Add --skps.
This does render_pictures, plus checks SkRecord optimizations.

Disable an SkRecord optimization that draws several bot SKPs wrong.  (To be investigated.)

BUG=skia:2378
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/270543004

git-svn-id: http://skia.googlecode.com/svn/trunk@14739 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-14 17:55:32 +00:00

24 lines
763 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 name)
: CpuTask(r, tr), fPicture(SkRef(pic)), fName(name) {}
void SKPTask::draw() {
SkBitmap bitmap;
SetupBitmap(kN32_SkColorType, *fPicture, &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, WriteTask::kVerbatim_Mode)));
}
} // namespace DM