OLD | NEW |
1 #include "DMSKPTask.h" | 1 #include "DMSKPTask.h" |
2 #include "DMUtil.h" | 2 #include "DMUtil.h" |
3 #include "DMWriteTask.h" | 3 #include "DMWriteTask.h" |
4 | 4 |
5 #include "SkCommandLineFlags.h" | 5 #include "SkCommandLineFlags.h" |
6 #include "SkPictureRecorder.h" | 6 #include "SkPictureRecorder.h" |
7 | 7 |
8 DECLARE_bool(skr); // in DMReplayTask.cpp | 8 DEFINE_bool(skr, true, "Test that SKPs draw the same when re-recorded with SkRec
ord backend."); |
9 | 9 |
10 namespace DM { | 10 namespace DM { |
11 | 11 |
12 // Test that an SkPicture plays back the same when re-recorded into an | 12 // Test that an SkPicture plays back the same when re-recorded into an |
13 // SkPicture backed by SkRecord. | 13 // SkPicture backed by SkRecord. |
14 class SkrComparisonTask : public CpuTask { | 14 class SkrComparisonTask : public CpuTask { |
15 public: | 15 public: |
16 SkrComparisonTask(const Task& parent, const SkPicture* picture, SkBitmap ref
erence) | 16 SkrComparisonTask(const Task& parent, const SkPicture* picture, SkBitmap ref
erence) |
17 : CpuTask(parent) | 17 : CpuTask(parent) |
18 , fPicture(picture) | 18 , fPicture(picture) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void SKPTask::draw() { | 50 void SKPTask::draw() { |
51 SkBitmap bitmap; | 51 SkBitmap bitmap; |
52 AllocatePixels(kN32_SkColorType, fPicture->width(), fPicture->height(), &bit
map); | 52 AllocatePixels(kN32_SkColorType, fPicture->width(), fPicture->height(), &bit
map); |
53 DrawPicture(*fPicture, &bitmap); | 53 DrawPicture(*fPicture, &bitmap); |
54 | 54 |
55 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 55 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
56 this->spawnChild(SkNEW_ARGS(SkrComparisonTask, (*this, fPicture.get(), bitma
p))); | 56 this->spawnChild(SkNEW_ARGS(SkrComparisonTask, (*this, fPicture.get(), bitma
p))); |
57 } | 57 } |
58 | 58 |
59 } // namespace DM | 59 } // namespace DM |
OLD | NEW |