blob: 1bc6a27478791c12af74119e5160dcb88e72c26b [file] [log] [blame]
commit-bot@chromium.orga90c6802014-04-30 13:20:45 +00001#ifndef DMQuiltTask_DEFINED
2#define DMQuiltTask_DEFINED
3
4#include "DMTask.h"
5#include "SkBitmap.h"
6#include "SkString.h"
7#include "SkTemplates.h"
8#include "gm.h"
9
10// Records a GM through an SkPicture, draws it in tiles, and compares against the reference bitmap.
11
12namespace DM {
13
14class QuiltTask : public CpuTask {
15
16public:
mtklein7cdc1ee2014-07-07 10:41:04 -070017 enum Mode {
mtkleine4636aa2014-07-09 13:10:58 -070018 kNoBBH_Mode,
19 kRTree_Mode,
20 kQuadTree_Mode,
21 kTileGrid_Mode,
22 kSkRecord_Mode, // Currently uses no BBH.
mtklein7cdc1ee2014-07-07 10:41:04 -070023 };
24
25 QuiltTask(const Task& parent, // QuiltTask must be a child task. Pass its parent here.
26 skiagm::GM*, // GM to run through a picture. Takes ownership.
27 SkBitmap reference, // Bitmap to compare picture replay results to.
28 Mode mode);
commit-bot@chromium.orga90c6802014-04-30 13:20:45 +000029
30 virtual void draw() SK_OVERRIDE;
31 virtual bool shouldSkip() const SK_OVERRIDE;
32 virtual SkString name() const SK_OVERRIDE { return fName; }
33
34private:
mtklein7cdc1ee2014-07-07 10:41:04 -070035 const Mode fMode;
commit-bot@chromium.orga90c6802014-04-30 13:20:45 +000036 const SkString fName;
37 SkAutoTDelete<skiagm::GM> fGM;
38 const SkBitmap fReference;
39};
40
41} // namespace DM
42
43#endif // DMReplayTask_DEFINED