OLD | NEW |
1 #include "DMGpuTask.h" | 1 #include "DMGpuTask.h" |
2 | 2 |
3 #include "DMComparisonTask.h" | 3 #include "DMChecksumTask.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 { |
11 | 11 |
12 GpuTask::GpuTask(const char* name, | 12 GpuTask::GpuTask(const char* name, |
13 Reporter* reporter, | 13 Reporter* reporter, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 59 #if GR_CACHE_STATS |
60 gr->printCacheStats(); | 60 gr->printCacheStats(); |
61 #endif | 61 #endif |
62 | 62 |
63 // We offload checksum comparison to the main CPU threadpool. | 63 this->spawnChild(SkNEW_ARGS(ChecksumTask, (*this, fExpectations, bitmap))); |
64 // This cuts run time by about 30%. | |
65 this->spawnChild(SkNEW_ARGS(ComparisonTask, (*this, fExpectations, bitmap)))
; | |
66 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 64 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
67 } | 65 } |
68 | 66 |
69 bool GpuTask::shouldSkip() const { | 67 bool GpuTask::shouldSkip() const { |
70 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); | 68 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); |
71 } | 69 } |
72 | 70 |
73 } // namespace DM | 71 } // namespace DM |
OLD | NEW |