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 { |
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 skiagm::ExpectationsSource& 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.get(Png(fName).c_str())) |
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 26 matching lines...) Expand all Loading... |
60 // This cuts run time by about 30%. | 60 // This cuts run time by about 30%. |
61 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))); | 62 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); |
63 } | 63 } |
64 | 64 |
65 bool GpuTask::shouldSkip() const { | 65 bool GpuTask::shouldSkip() const { |
66 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); | 66 return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); |
67 } | 67 } |
68 | 68 |
69 } // namespace DM | 69 } // namespace DM |
OLD | NEW |