| OLD | NEW |
| 1 #include "DMRecordTask.h" | 1 #include "DMRecordTask.h" |
| 2 #include "DMUtil.h" | 2 #include "DMUtil.h" |
| 3 #include "DMWriteTask.h" | 3 #include "DMWriteTask.h" |
| 4 #include "SkCommandLineFlags.h" | 4 #include "SkCommandLineFlags.h" |
| 5 #include "SkRecord.h" | 5 #include "SkRecord.h" |
| 6 #include "SkRecordDraw.h" | 6 #include "SkRecordDraw.h" |
| 7 #include "SkRecordOpts.h" | 7 #include "SkRecordOpts.h" |
| 8 #include "SkRecorder.h" | 8 #include "SkRecorder.h" |
| 9 | 9 |
| 10 DEFINE_bool(skr, true, "If true, run SKR tests."); | 10 DEFINE_bool(skr, true, "If true, run SKR tests."); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 fPicture->draw(&recorder); | 40 fPicture->draw(&recorder); |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 if (fOptimize) { | 44 if (fOptimize) { |
| 45 SkRecordOptimize(&record); | 45 SkRecordOptimize(&record); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Draw the SkRecord back into a bitmap. | 48 // Draw the SkRecord back into a bitmap. |
| 49 SkBitmap bitmap; | 49 SkBitmap bitmap; |
| 50 if (fGM.get()) { | 50 AllocatePixels(fReference, &bitmap); |
| 51 SetupBitmap(fReference.colorType(), fGM.get(), &bitmap); | |
| 52 } else { | |
| 53 SetupBitmap(fReference.colorType(), *fPicture, &bitmap); | |
| 54 } | |
| 55 SkCanvas target(bitmap); | 51 SkCanvas target(bitmap); |
| 56 SkRecordDraw(record, &target); | 52 SkRecordDraw(record, &target); |
| 57 | 53 |
| 58 if (!BitmapsEqual(bitmap, fReference)) { | 54 if (!BitmapsEqual(bitmap, fReference)) { |
| 59 this->fail(); | 55 this->fail(); |
| 60 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 56 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
| 61 } | 57 } |
| 62 } | 58 } |
| 63 | 59 |
| 64 bool RecordTask::shouldSkip() const { | 60 bool RecordTask::shouldSkip() const { |
| 65 return !FLAGS_skr; | 61 return !FLAGS_skr; |
| 66 } | 62 } |
| 67 | 63 |
| 68 } // namespace DM | 64 } // namespace DM |
| OLD | NEW |