OLD | NEW |
(Empty) | |
| 1 #ifndef DMBenchTask_DEFINED |
| 2 #define DMBenchTask_DEFINED |
| 3 |
| 4 #include "DMReporter.h" |
| 5 #include "DMTask.h" |
| 6 #include "DMTaskRunner.h" |
| 7 #include "SkBenchmark.h" |
| 8 #include "SkString.h" |
| 9 #include "SkTemplates.h" |
| 10 |
| 11 // Tasks that run an SkBenchmark once as a check that it doesn't crash. |
| 12 |
| 13 namespace DM { |
| 14 |
| 15 class NonRenderingBenchTask : public Task { |
| 16 public: |
| 17 NonRenderingBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegis
try::Factory); |
| 18 |
| 19 virtual void draw() SK_OVERRIDE; |
| 20 virtual bool usesGpu() const SK_OVERRIDE { return false; } |
| 21 virtual bool shouldSkip() const SK_OVERRIDE; |
| 22 virtual SkString name() const SK_OVERRIDE { return fName; } |
| 23 |
| 24 private: |
| 25 SkAutoTDelete<SkBenchmark> fBench; |
| 26 const SkString fName; |
| 27 }; |
| 28 |
| 29 class CpuBenchTask : public Task { |
| 30 public: |
| 31 CpuBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Fact
ory, SkColorType); |
| 32 |
| 33 virtual void draw() SK_OVERRIDE; |
| 34 virtual bool usesGpu() const SK_OVERRIDE { return false; } |
| 35 virtual bool shouldSkip() const SK_OVERRIDE; |
| 36 virtual SkString name() const SK_OVERRIDE { return fName; } |
| 37 |
| 38 private: |
| 39 SkAutoTDelete<SkBenchmark> fBench; |
| 40 const SkString fName; |
| 41 const SkColorType fColorType; |
| 42 }; |
| 43 |
| 44 class GpuBenchTask : public Task { |
| 45 public: |
| 46 GpuBenchTask(const char* config, |
| 47 Reporter*, |
| 48 TaskRunner*, |
| 49 BenchRegistry::Factory, |
| 50 GrContextFactory::GLContextType, |
| 51 int sampleCount); |
| 52 |
| 53 virtual void draw() SK_OVERRIDE; |
| 54 virtual bool usesGpu() const SK_OVERRIDE { return true; } |
| 55 virtual bool shouldSkip() const SK_OVERRIDE; |
| 56 virtual SkString name() const SK_OVERRIDE { return fName; } |
| 57 |
| 58 private: |
| 59 SkAutoTDelete<SkBenchmark> fBench; |
| 60 const SkString fName; |
| 61 const GrContextFactory::GLContextType fContextType; |
| 62 int fSampleCount; |
| 63 }; |
| 64 |
| 65 } // namespace DM |
| 66 |
| 67 #endif // DMBenchTask_DEFINED |
OLD | NEW |