blob: 1245009923043d2b1bb8e8db94fba8ae015d5b55 [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#ifndef DMReplayTask_DEFINED
2#define DMReplayTask_DEFINED
3
mtklein@google.comd36522d2013-10-16 13:02:15 +00004#include "DMTask.h"
mtklein@google.comd36522d2013-10-16 13:02:15 +00005#include "SkBitmap.h"
6#include "SkString.h"
7#include "SkTemplates.h"
8#include "gm.h"
mtklein@google.comd36522d2013-10-16 13:02:15 +00009
commit-bot@chromium.org66bb3d12013-10-16 19:13:38 +000010// Records a GM through an SkPicture, draws it, and compares against the reference bitmap.
mtklein@google.comd36522d2013-10-16 13:02:15 +000011
12namespace DM {
13
14class ReplayTask : public Task {
15
16public:
commit-bot@chromium.orgc1362422013-10-30 20:45:28 +000017 ReplayTask(const Task& parent, // ReplayTask must be a child task. Pass its parent here.
rmistry@google.comd6bab022013-12-02 13:50:38 +000018 skiagm::GM*, // GM to run through a picture. Takes ownership.
19 SkBitmap reference, // Bitmap to compare picture replay results to.
commit-bot@chromium.orgc1362422013-10-30 20:45:28 +000020 bool useRTree); // Record with an RTree?
mtklein@google.comd36522d2013-10-16 13:02:15 +000021
22 virtual void draw() SK_OVERRIDE;
23 virtual bool usesGpu() const SK_OVERRIDE { return false; }
24 virtual bool shouldSkip() const SK_OVERRIDE;
25 virtual SkString name() const SK_OVERRIDE { return fName; }
26
27private:
28 const SkString fName;
29 SkAutoTDelete<skiagm::GM> fGM;
commit-bot@chromium.org66bb3d12013-10-16 19:13:38 +000030 const SkBitmap fReference;
commit-bot@chromium.orgc1362422013-10-30 20:45:28 +000031 const bool fUseRTree;
mtklein@google.comd36522d2013-10-16 13:02:15 +000032};
33
34} // namespace DM
35
36#endif // DMReplayTask_DEFINED