blob: bf90f72a0e5282e35df20219d3666ac690a6fa23 [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.org192cbf62013-10-21 18:40:25 +000017 ReplayTask(const Task& parent,
mtklein@google.comd36522d2013-10-16 13:02:15 +000018 skiagm::GM*,
commit-bot@chromium.org66bb3d12013-10-16 19:13:38 +000019 SkBitmap reference);
mtklein@google.comd36522d2013-10-16 13:02:15 +000020
21 virtual void draw() SK_OVERRIDE;
22 virtual bool usesGpu() const SK_OVERRIDE { return false; }
23 virtual bool shouldSkip() const SK_OVERRIDE;
24 virtual SkString name() const SK_OVERRIDE { return fName; }
25
26private:
27 const SkString fName;
28 SkAutoTDelete<skiagm::GM> fGM;
commit-bot@chromium.org66bb3d12013-10-16 19:13:38 +000029 const SkBitmap fReference;
mtklein@google.comd36522d2013-10-16 13:02:15 +000030};
31
32} // namespace DM
33
34#endif // DMReplayTask_DEFINED