| OLD | NEW |
| 1 #include "DMGpuTask.h" | 1 #include "DMGpuTask.h" |
| 2 | 2 |
| 3 #include "DMComparisonTask.h" | 3 #include "DMComparisonTask.h" |
| 4 #include "DMUtil.h" | 4 #include "DMUtil.h" |
| 5 #include "DMWriteTask.h" |
| 5 #include "SkCommandLineFlags.h" | 6 #include "SkCommandLineFlags.h" |
| 6 #include "SkGpuDevice.h" | 7 #include "SkGpuDevice.h" |
| 7 #include "SkTLS.h" | 8 #include "SkTLS.h" |
| 8 | 9 |
| 9 namespace DM { | 10 namespace DM { |
| 10 | 11 |
| 11 GpuTask::GpuTask(const char* name, | 12 GpuTask::GpuTask(const char* name, |
| 12 Reporter* reporter, | 13 Reporter* reporter, |
| 13 TaskRunner* taskRunner, | 14 TaskRunner* taskRunner, |
| 14 const skiagm::ExpectationsSource& expectations, | 15 const skiagm::ExpectationsSource& expectations, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 fGM->draw(&canvas); | 52 fGM->draw(&canvas); |
| 52 canvas.flush(); | 53 canvas.flush(); |
| 53 | 54 |
| 54 SkBitmap bitmap; | 55 SkBitmap bitmap; |
| 55 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt
(fGM->height())); | 56 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt
(fGM->height())); |
| 56 canvas.readPixels(&bitmap, 0, 0); | 57 canvas.readPixels(&bitmap, 0, 0); |
| 57 | 58 |
| 58 // We offload checksum comparison to the main CPU threadpool. | 59 // We offload checksum comparison to the main CPU threadpool. |
| 59 // This cuts run time by about 30%. | 60 // This cuts run time by about 30%. |
| 60 this->spawnChild(SkNEW_ARGS(ComparisonTask, (*this, fExpectations, bitmap)))
; | 61 this->spawnChild(SkNEW_ARGS(ComparisonTask, (*this, fExpectations, bitmap)))
; |
| 62 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
| 61 } | 63 } |
| 62 | 64 |
| 63 bool GpuTask::shouldSkip() const { | 65 bool GpuTask::shouldSkip() const { |
| 64 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); | 66 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace DM | 69 } // namespace DM |
| OLD | NEW |