OLD | NEW |
1 #ifndef DMRecordTask_DEFINED | 1 #ifndef DMRecordTask_DEFINED |
2 #define DMRecordTask_DEFINED | 2 #define DMRecordTask_DEFINED |
3 | 3 |
4 #include "DMTask.h" | 4 #include "DMTask.h" |
5 #include "SkBitmap.h" | 5 #include "SkBitmap.h" |
| 6 #include "SkPicture.h" |
6 #include "SkString.h" | 7 #include "SkString.h" |
7 #include "SkTemplates.h" | 8 #include "SkTemplates.h" |
8 #include "gm.h" | 9 #include "gm.h" |
9 | 10 |
10 // Records a GM through an SkRecord, draws it, and compares against the referenc
e bitmap. | 11 // Records a GM or SKP through an SkRecord, draws it, and compares against the r
eference bitmap. |
11 | 12 |
12 namespace DM { | 13 namespace DM { |
13 | 14 |
14 class RecordTask : public CpuTask { | 15 class RecordTask : public CpuTask { |
15 | 16 |
16 public: | 17 public: |
17 RecordTask(const Task& parent, skiagm::GM*, SkBitmap reference, bool optimiz
e); | 18 enum Mode { |
| 19 kNoOptimize_Mode, |
| 20 kOptimize_Mode, |
| 21 }; |
| 22 RecordTask(const Task& parent, skiagm::GM*, SkBitmap reference, Mode); |
| 23 RecordTask(const Task& parent, SkPicture*, SkBitmap reference, Mode); |
18 | 24 |
19 virtual void draw() SK_OVERRIDE; | 25 virtual void draw() SK_OVERRIDE; |
20 virtual bool shouldSkip() const SK_OVERRIDE; | 26 virtual bool shouldSkip() const SK_OVERRIDE; |
21 virtual SkString name() const SK_OVERRIDE { return fName; } | 27 virtual SkString name() const SK_OVERRIDE { return fName; } |
22 | 28 |
23 private: | 29 private: |
| 30 bool fOptimize; |
24 const SkString fName; | 31 const SkString fName; |
| 32 SkAutoTUnref<SkPicture> fPicture; |
25 SkAutoTDelete<skiagm::GM> fGM; | 33 SkAutoTDelete<skiagm::GM> fGM; |
26 const SkBitmap fReference; | 34 const SkBitmap fReference; |
27 bool fOptimize; | |
28 }; | 35 }; |
29 | 36 |
30 } // namespace DM | 37 } // namespace DM |
31 | 38 |
32 #endif // DMRecordTask_DEFINED | 39 #endif // DMRecordTask_DEFINED |
OLD | NEW |