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

Unified Diff: dm/DMCpuTask.cpp

Issue 88543002: DM: some refactoring (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
Index: dm/DMCpuTask.cpp
diff --git a/dm/DMCpuTask.cpp b/dm/DMCpuTask.cpp
index 1d1d4010f7f675ad225b477ea2e036fb10f92b26..263e55667ee95a40ad1b0c14c4758df9befc6473 100644
--- a/dm/DMCpuTask.cpp
+++ b/dm/DMCpuTask.cpp
@@ -1,4 +1,5 @@
#include "DMCpuTask.h"
+#include "DMChecksumTask.h"
#include "DMPipeTask.h"
#include "DMReplayTask.h"
#include "DMSerializeTask.h"
@@ -30,19 +31,20 @@ void CpuTask::draw() {
fGM->draw(&canvas);
canvas.flush();
- if (!MeetsExpectations(fExpectations, bitmap)) {
- this->fail();
- }
+#define SPAWN(ChildTask, ...) this->spawnChild(SkNEW_ARGS(ChildTask, (*this, __VA_ARGS__)))
+ SPAWN(ChecksumTask, fExpectations, bitmap);
+
+ SPAWN(PipeTask, fGMFactory(NULL), bitmap, false, false);
+ SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, false);
+ SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, true);
- this->spawnChild(SkNEW_ARGS(PipeTask, (*this, fGMFactory(NULL), bitmap, false, false)));
- this->spawnChild(SkNEW_ARGS(PipeTask, (*this, fGMFactory(NULL), bitmap, true, false)));
- this->spawnChild(SkNEW_ARGS(PipeTask, (*this, fGMFactory(NULL), bitmap, true, true)));
+ SPAWN(ReplayTask, fGMFactory(NULL), bitmap, false);
+ SPAWN(ReplayTask, fGMFactory(NULL), bitmap, true);
- this->spawnChild(SkNEW_ARGS(ReplayTask, (*this, fGMFactory(NULL), bitmap, true)));
- this->spawnChild(SkNEW_ARGS(ReplayTask, (*this, fGMFactory(NULL), bitmap, false)));
+ SPAWN(SerializeTask, fGMFactory(NULL), bitmap);
- this->spawnChild(SkNEW_ARGS(SerializeTask, (*this, fGMFactory(NULL), bitmap)));
- this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
+ SPAWN(WriteTask, bitmap);
+#undef SPAWN
}
bool CpuTask::shouldSkip() const {

Powered by Google App Engine
This is Rietveld 408576698