Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1396)

Unified Diff: dm/DMCpuTask.cpp

Issue 32613003: DM: add --serialize (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: no-find-copies Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMComparisonTask.cpp ('k') | dm/DMGpuTask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
+ this->spawnChild(SkNEW_ARGS(SerializeTask, (*this, fGMFactory(NULL), bitmap)));
this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
}
« no previous file with comments | « dm/DMComparisonTask.cpp ('k') | dm/DMGpuTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698