| 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 "DMWriteTask.h" |
| 6 #include "SkCommandLineFlags.h" | 6 #include "SkCommandLineFlags.h" |
| 7 #include "SkGpuDevice.h" | 7 #include "SkGpuDevice.h" |
| 8 #include "SkTLS.h" | 8 #include "SkTLS.h" |
| 9 | 9 |
| 10 namespace DM { | 10 namespace DM { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 SkCanvas canvas(&device); | 49 SkCanvas canvas(&device); |
| 50 | 50 |
| 51 canvas.concat(fGM->getInitialTransform()); | 51 canvas.concat(fGM->getInitialTransform()); |
| 52 fGM->draw(&canvas); | 52 fGM->draw(&canvas); |
| 53 canvas.flush(); | 53 canvas.flush(); |
| 54 | 54 |
| 55 SkBitmap bitmap; | 55 SkBitmap bitmap; |
| 56 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt
(fGM->height())); | 56 bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt
(fGM->height())); |
| 57 canvas.readPixels(&bitmap, 0, 0); | 57 canvas.readPixels(&bitmap, 0, 0); |
| 58 | 58 |
| 59 #if GR_CACHE_STATS |
| 60 gr->printCacheStats(); |
| 61 #endif |
| 62 |
| 59 // We offload checksum comparison to the main CPU threadpool. | 63 // We offload checksum comparison to the main CPU threadpool. |
| 60 // This cuts run time by about 30%. | 64 // This cuts run time by about 30%. |
| 61 this->spawnChild(SkNEW_ARGS(ComparisonTask, (*this, fExpectations, bitmap)))
; | 65 this->spawnChild(SkNEW_ARGS(ComparisonTask, (*this, fExpectations, bitmap)))
; |
| 62 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 66 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
| 63 } | 67 } |
| 64 | 68 |
| 65 bool GpuTask::shouldSkip() const { | 69 bool GpuTask::shouldSkip() const { |
| 66 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); | 70 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); |
| 67 } | 71 } |
| 68 | 72 |
| 69 } // namespace DM | 73 } // namespace DM |
| OLD | NEW |