commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 1 | #ifndef DMSerializeTask_DEFINED |
| 2 | #define DMSerializeTask_DEFINED |
| 3 | |
| 4 | #include "DMTask.h" |
| 5 | #include "SkBitmap.h" |
| 6 | #include "SkString.h" |
| 7 | #include "SkTemplates.h" |
| 8 | #include "gm.h" |
| 9 | |
| 10 | // Record a picture, serialize it, deserialize it, then draw it and compare to reference bitmap. |
| 11 | |
| 12 | namespace DM { |
| 13 | |
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 14 | class SerializeTask : public CpuTask { |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 15 | |
| 16 | public: |
mtklein | 7373456 | 2014-06-24 12:28:34 -0700 | [diff] [blame] | 17 | enum Mode { |
| 18 | kNormal_Mode, |
| 19 | kSkRecord_Mode, |
| 20 | }; |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 21 | SerializeTask(const Task& parent, |
| 22 | skiagm::GM*, |
mtklein | 7373456 | 2014-06-24 12:28:34 -0700 | [diff] [blame] | 23 | SkBitmap reference, |
| 24 | Mode mode); |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 25 | |
| 26 | virtual void draw() SK_OVERRIDE; |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 27 | virtual bool shouldSkip() const SK_OVERRIDE; |
| 28 | virtual SkString name() const SK_OVERRIDE { return fName; } |
| 29 | |
| 30 | private: |
mtklein | 7373456 | 2014-06-24 12:28:34 -0700 | [diff] [blame] | 31 | const Mode fMode; |
commit-bot@chromium.org | 192cbf6 | 2013-10-21 18:40:25 +0000 | [diff] [blame] | 32 | const SkString fName; |
| 33 | SkAutoTDelete<skiagm::GM> fGM; |
| 34 | const SkBitmap fReference; |
| 35 | }; |
| 36 | |
| 37 | } // namespace DM |
| 38 | |
| 39 | #endif // DMSerializeTask_DEFINED |