Chromium Code Reviews| Index: dm/DMCpuTask.cpp |
| diff --git a/dm/DMCpuTask.cpp b/dm/DMCpuTask.cpp |
| index 316f3412c57cc38a17b41622ecf0eafa563f441a..f6edf23407946955ee0f979dc16ba85883159df1 100644 |
| --- a/dm/DMCpuTask.cpp |
| +++ b/dm/DMCpuTask.cpp |
| @@ -1,11 +1,8 @@ |
| #include "DMCpuTask.h" |
| #include "DMReplayTask.h" |
| +#include "DMSerializeTask.h" |
| #include "DMUtil.h" |
| #include "DMWriteTask.h" |
| -#include "SkCommandLineFlags.h" |
| - |
| -DEFINE_bool(replay, false, "If true, run replay tests for each CpuTask."); |
| -// TODO(mtklein): add the other various options |
| namespace DM { |
| @@ -18,30 +15,26 @@ CpuTask::CpuTask(const char* name, |
| : Task(reporter, taskRunner) |
| , fGMFactory(gmFactory) |
| , fGM(fGMFactory(NULL)) |
| - , fName(underJoin(fGM->shortName(), name)) |
| - , fExpectations(expectations.get(png(fName).c_str())) |
| + , fName(UnderJoin(fGM->shortName(), name)) |
| + , fExpectations(expectations.get(Png(fName).c_str())) |
| , fConfig(config) |
| {} |
| void CpuTask::draw() { |
| SkBitmap bitmap; |
| - bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height())); |
| - bitmap.allocPixels(); |
| - bitmap.eraseColor(0x00000000); |
| - SkCanvas canvas(bitmap); |
| + SetupBitmap(fConfig, fGM.get(), &bitmap); |
| + SkCanvas canvas(bitmap); |
| canvas.concat(fGM->getInitialTransform()); |
| fGM->draw(&canvas); |
| canvas.flush(); |
| - if (!meetsExpectations(fExpectations, bitmap)) { |
| + if (!MeetsExpectations(fExpectations, bitmap)) { |
| this->fail(); |
| } |
| - if (FLAGS_replay) { |
| - this->spawnChild(SkNEW_ARGS(ReplayTask, |
| - ("replay", *this, fGMFactory(NULL), bitmap))); |
| - } |
| + this->spawnChild(SkNEW_ARGS(ReplayTask, (*this, fGMFactory(NULL), bitmap))); |
|
bsalomon
2013/10/21 17:34:01
Does this mean we always run replay and serialize
mtklein
2013/10/21 17:51:46
Not quite. It means those tasks will always be cr
|
| + this->spawnChild(SkNEW_ARGS(SerializeTask, (*this, fGMFactory(NULL), bitmap))); |
| this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
| } |