OLD | NEW |
1 #include "DMCpuTask.h" | 1 #include "DMCpuTask.h" |
| 2 #include "DMChecksumTask.h" |
2 #include "DMPipeTask.h" | 3 #include "DMPipeTask.h" |
3 #include "DMReplayTask.h" | 4 #include "DMReplayTask.h" |
4 #include "DMSerializeTask.h" | 5 #include "DMSerializeTask.h" |
5 #include "DMUtil.h" | 6 #include "DMUtil.h" |
6 #include "DMWriteTask.h" | 7 #include "DMWriteTask.h" |
7 | 8 |
8 namespace DM { | 9 namespace DM { |
9 | 10 |
10 CpuTask::CpuTask(const char* name, | 11 CpuTask::CpuTask(const char* name, |
11 Reporter* reporter, | 12 Reporter* reporter, |
(...skipping 11 matching lines...) Expand all Loading... |
23 | 24 |
24 void CpuTask::draw() { | 25 void CpuTask::draw() { |
25 SkBitmap bitmap; | 26 SkBitmap bitmap; |
26 SetupBitmap(fConfig, fGM.get(), &bitmap); | 27 SetupBitmap(fConfig, fGM.get(), &bitmap); |
27 | 28 |
28 SkCanvas canvas(bitmap); | 29 SkCanvas canvas(bitmap); |
29 canvas.concat(fGM->getInitialTransform()); | 30 canvas.concat(fGM->getInitialTransform()); |
30 fGM->draw(&canvas); | 31 fGM->draw(&canvas); |
31 canvas.flush(); | 32 canvas.flush(); |
32 | 33 |
33 if (!MeetsExpectations(fExpectations, bitmap)) { | 34 #define SPAWN(ChildTask, ...) this->spawnChild(SkNEW_ARGS(ChildTask, (*this, __V
A_ARGS__))) |
34 this->fail(); | 35 SPAWN(ChecksumTask, fExpectations, bitmap); |
35 } | |
36 | 36 |
37 this->spawnChild(SkNEW_ARGS(PipeTask, (*this, fGMFactory(NULL), bitmap, fals
e, false))); | 37 SPAWN(PipeTask, fGMFactory(NULL), bitmap, false, false); |
38 this->spawnChild(SkNEW_ARGS(PipeTask, (*this, fGMFactory(NULL), bitmap, true
, false))); | 38 SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, false); |
39 this->spawnChild(SkNEW_ARGS(PipeTask, (*this, fGMFactory(NULL), bitmap, true
, true))); | 39 SPAWN(PipeTask, fGMFactory(NULL), bitmap, true, true); |
40 | 40 |
41 this->spawnChild(SkNEW_ARGS(ReplayTask, (*this, fGMFactory(NULL), bitmap, tr
ue))); | 41 SPAWN(ReplayTask, fGMFactory(NULL), bitmap, false); |
42 this->spawnChild(SkNEW_ARGS(ReplayTask, (*this, fGMFactory(NULL), bitmap, fa
lse))); | 42 SPAWN(ReplayTask, fGMFactory(NULL), bitmap, true); |
43 | 43 |
44 this->spawnChild(SkNEW_ARGS(SerializeTask, (*this, fGMFactory(NULL), bitmap)
)); | 44 SPAWN(SerializeTask, fGMFactory(NULL), bitmap); |
45 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 45 |
| 46 SPAWN(WriteTask, bitmap); |
| 47 #undef SPAWN |
46 } | 48 } |
47 | 49 |
48 bool CpuTask::shouldSkip() const { | 50 bool CpuTask::shouldSkip() const { |
49 if (SkBitmap::kRGB_565_Config == fConfig && (fGM->getFlags() & skiagm::GM::k
Skip565_Flag)) { | 51 if (SkBitmap::kRGB_565_Config == fConfig && (fGM->getFlags() & skiagm::GM::k
Skip565_Flag)) { |
50 return true; | 52 return true; |
51 } | 53 } |
52 if (fGM->getFlags() & skiagm::GM::kGPUOnly_Flag) { | 54 if (fGM->getFlags() & skiagm::GM::kGPUOnly_Flag) { |
53 return true; | 55 return true; |
54 } | 56 } |
55 return false; | 57 return false; |
56 } | 58 } |
57 | 59 |
58 } // namespace DM | 60 } // namespace DM |
OLD | NEW |