OLD | NEW |
1 #include "DMGpuTask.h" | 1 #include "DMGpuTask.h" |
2 | 2 |
3 #include "DMChecksumTask.h" | 3 #include "DMExpectationsTask.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, |
14 TaskRunner* taskRunner, | 14 TaskRunner* taskRunner, |
15 const skiagm::ExpectationsSource& expectations, | 15 const Expectations& expectations, |
16 skiagm::GMRegistry::Factory gmFactory, | 16 skiagm::GMRegistry::Factory gmFactory, |
17 SkBitmap::Config config, | 17 SkBitmap::Config config, |
18 GrContextFactory::GLContextType contextType, | 18 GrContextFactory::GLContextType contextType, |
19 int sampleCount) | 19 int sampleCount) |
20 : Task(reporter, taskRunner) | 20 : Task(reporter, taskRunner) |
21 , fGM(gmFactory(NULL)) | 21 , fGM(gmFactory(NULL)) |
22 , fName(UnderJoin(fGM->shortName(), name)) | 22 , fName(UnderJoin(fGM->shortName(), name)) |
23 , fExpectations(expectations.get(Png(fName).c_str())) | 23 , fExpectations(expectations) |
24 , fConfig(config) | 24 , fConfig(config) |
25 , fContextType(contextType) | 25 , fContextType(contextType) |
26 , fSampleCount(sampleCount) | 26 , fSampleCount(sampleCount) |
27 {} | 27 {} |
28 | 28 |
29 static void* new_gr_context_factory() { | 29 static void* new_gr_context_factory() { |
30 return SkNEW(GrContextFactory); | 30 return SkNEW(GrContextFactory); |
31 } | 31 } |
32 | 32 |
33 static void delete_gr_context_factory(void* factory) { | 33 static void delete_gr_context_factory(void* factory) { |
(...skipping 19 matching lines...) Expand all 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 this->spawnChild(SkNEW_ARGS(ChecksumTask, (*this, fExpectations, bitmap))); | 63 this->spawnChild(SkNEW_ARGS(ExpectationsTask, (*this, fExpectations, bitmap)
)); |
64 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); | 64 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
65 } | 65 } |
66 | 66 |
67 bool GpuTask::shouldSkip() const { | 67 bool GpuTask::shouldSkip() const { |
68 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); | 68 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); |
69 } | 69 } |
70 | 70 |
71 } // namespace DM | 71 } // namespace DM |
OLD | NEW |