commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 1 | #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 | |
| 12 | namespace DM { |
| 13 | |
| 14 | class QuiltTask : public CpuTask { |
| 15 | |
| 16 | public: |
mtklein | 7cdc1ee | 2014-07-07 10:41:04 -0700 | [diff] [blame] | 17 | enum Mode { |
mtklein | e4636aa | 2014-07-09 13:10:58 -0700 | [diff] [blame] | 18 | kNoBBH_Mode, |
| 19 | kRTree_Mode, |
| 20 | kQuadTree_Mode, |
| 21 | kTileGrid_Mode, |
| 22 | kSkRecord_Mode, // Currently uses no BBH. |
mtklein | 7cdc1ee | 2014-07-07 10:41:04 -0700 | [diff] [blame] | 23 | }; |
| 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.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 29 | |
| 30 | virtual void draw() SK_OVERRIDE; |
| 31 | virtual bool shouldSkip() const SK_OVERRIDE; |
| 32 | virtual SkString name() const SK_OVERRIDE { return fName; } |
| 33 | |
| 34 | private: |
mtklein | 7cdc1ee | 2014-07-07 10:41:04 -0700 | [diff] [blame] | 35 | const Mode fMode; |
commit-bot@chromium.org | a90c680 | 2014-04-30 13:20:45 +0000 | [diff] [blame] | 36 | const SkString fName; |
| 37 | SkAutoTDelete<skiagm::GM> fGM; |
| 38 | const SkBitmap fReference; |
| 39 | }; |
| 40 | |
| 41 | } // namespace DM |
| 42 | |
| 43 | #endif // DMReplayTask_DEFINED |