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

Unified Diff: dm/DMReplayTask.cpp

Issue 377373003: Merge Replay and Quilt tasks, adding in all BBH implementations. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/DMReplayTask.h ('k') | dm/DMSKPTask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMReplayTask.cpp
diff --git a/dm/DMReplayTask.cpp b/dm/DMReplayTask.cpp
deleted file mode 100644
index 7fd58cef6a4cf777ab789366aa80bb005e86f090..0000000000000000000000000000000000000000
--- a/dm/DMReplayTask.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "DMReplayTask.h"
-#include "DMWriteTask.h"
-#include "DMUtil.h"
-
-#include "SkBBHFactory.h"
-#include "SkCommandLineFlags.h"
-#include "SkPicture.h"
-
-DEFINE_bool(replay, true, "If true, run picture replay tests.");
-DEFINE_bool(rtree, true, "If true, run picture replay tests with an rtree.");
-DEFINE_bool(skr, true, "If true, run picture replay tests with SkRecord backend.");
-
-static const char* kSuffixes[] = { "replay", "rtree", "skr" };
-static const bool* kEnabled[] = { &FLAGS_replay, &FLAGS_rtree, &FLAGS_skr };
-
-namespace DM {
-
-ReplayTask::ReplayTask(const Task& parent,
- skiagm::GM* gm,
- SkBitmap reference,
- Mode mode)
- : CpuTask(parent)
- , fMode(mode)
- , fName(UnderJoin(parent.name().c_str(), kSuffixes[mode]))
- , fGM(gm)
- , fReference(reference)
- {}
-
-void ReplayTask::draw() {
- SkAutoTDelete<SkBBHFactory> factory;
- if (kRTree_Mode == fMode) {
- factory.reset(SkNEW(SkRTreeFactory));
- }
- SkAutoTUnref<SkPicture> recorded(
- RecordPicture(fGM.get(), factory.get(), kSkRecord_Mode == fMode));
-
- SkBitmap bitmap;
- AllocatePixels(fReference, &bitmap);
- DrawPicture(*recorded, &bitmap);
- if (!BitmapsEqual(bitmap, fReference)) {
- this->fail();
- this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
- }
-}
-
-bool ReplayTask::shouldSkip() const {
- if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) {
- return true;
- }
- return !*kEnabled[fMode];
-}
-
-} // namespace DM
« no previous file with comments | « dm/DMReplayTask.h ('k') | dm/DMSKPTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698