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 12 matching lines...) Expand all Loading... |
23 : CpuTask(parent) | 23 : CpuTask(parent) |
24 , fOptimize(mode == kOptimize_Mode) | 24 , fOptimize(mode == kOptimize_Mode) |
25 , fName(UnderJoin(parent.name().c_str(), fOptimize ? "skr" : "skr-noopt")) | 25 , fName(UnderJoin(parent.name().c_str(), fOptimize ? "skr" : "skr-noopt")) |
26 , fPicture(SkRef(pic)) | 26 , fPicture(SkRef(pic)) |
27 , fReference(reference) | 27 , fReference(reference) |
28 {} | 28 {} |
29 | 29 |
30 void RecordTask::draw() { | 30 void RecordTask::draw() { |
31 // Record into an SkRecord. | 31 // Record into an SkRecord. |
32 SkRecord record; | 32 SkRecord record; |
33 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, | 33 SkRecorder recorder(&record, fReference.width(), fReference.height()); |
34 fReference.width(), fReference.height()); | |
35 | 34 |
36 if (fGM.get()) { | 35 if (fGM.get()) { |
37 recorder.concat(fGM->getInitialTransform()); | 36 recorder.concat(fGM->getInitialTransform()); |
38 fGM->draw(&recorder); | 37 fGM->draw(&recorder); |
39 } else { | 38 } else { |
40 fPicture->draw(&recorder); | 39 fPicture->draw(&recorder); |
41 } | 40 } |
42 | 41 |
43 | 42 |
44 if (fOptimize) { | 43 if (fOptimize) { |
(...skipping 10 matching lines...) Expand all Loading... |
55 this->fail(); | 54 this->fail(); |
56 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 55 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
57 } | 56 } |
58 } | 57 } |
59 | 58 |
60 bool RecordTask::shouldSkip() const { | 59 bool RecordTask::shouldSkip() const { |
61 return !FLAGS_skr; | 60 return !FLAGS_skr; |
62 } | 61 } |
63 | 62 |
64 } // namespace DM | 63 } // namespace DM |
OLD | NEW |