blob: 0ed9351c137ae7c9dc09e52bc859c1fe66a82a31 [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#ifndef DMReplayTask_DEFINED
2#define DMReplayTask_DEFINED
3
4#include "DMReporter.h"
5#include "DMTask.h"
6#include "DMTaskRunner.h"
7#include "SkBitmap.h"
8#include "SkString.h"
9#include "SkTemplates.h"
10#include "gm.h"
11#include "gm_expectations.h"
12
13// Records a GM through an SkPicture, draws it, and compares against the reference checksum.
14
15namespace DM {
16
17class ReplayTask : public Task {
18
19public:
20 ReplayTask(const char* name,
21 const Task& parent,
22 skiagm::GM*,
23 skiagm::GmResultDigest reference,
24 SkBitmap::Config);
25
26 virtual void draw() SK_OVERRIDE;
27 virtual bool usesGpu() const SK_OVERRIDE { return false; }
28 virtual bool shouldSkip() const SK_OVERRIDE;
29 virtual SkString name() const SK_OVERRIDE { return fName; }
30
31private:
32 const SkString fName;
33 SkAutoTDelete<skiagm::GM> fGM;
34 const skiagm::GmResultDigest fReference;
35 const SkBitmap::Config fConfig;
36};
37
38} // namespace DM
39
40#endif // DMReplayTask_DEFINED