blob: 998ed7ba4d13fec632597701c49f6cefaa4f211b [file] [log] [blame]
mtklein@google.comd36522d2013-10-16 13:02:15 +00001#ifndef DMCpuTask_DEFINED
2#define DMCpuTask_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// This is the main entry point for drawing GMs with the CPU. Commandline
14// flags control whether this kicks off various comparison tasks when done.
15// Currently:
16// --replay: spawn a DMReplayTask to record into a picture, draw the picture, and compare.
17
18namespace DM {
19
20class CpuTask : public Task {
21public:
22 CpuTask(const char* name,
23 Reporter*,
24 TaskRunner*,
25 const skiagm::ExpectationsSource&,
26 skiagm::GMRegistry::Factory,
27 SkBitmap::Config);
28
29 virtual void draw() SK_OVERRIDE;
30 virtual bool usesGpu() const SK_OVERRIDE { return false; }
31 virtual bool shouldSkip() const SK_OVERRIDE;
32 virtual SkString name() const SK_OVERRIDE { return fName; }
33
34private:
35 skiagm::GMRegistry::Factory fGMFactory;
36 SkAutoTDelete<skiagm::GM> fGM;
37 const SkString fName;
38 const skiagm::Expectations fExpectations;
39 const SkBitmap::Config fConfig;
40};
41
42} // namespace DM
43
44#endif // DMCpuTask_DEFINED