commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 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 | |
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 15 | class NonRenderingBenchTask : public CpuTask { |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 16 | public: |
| 17 | NonRenderingBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Factory); |
| 18 | |
| 19 | virtual void draw() SK_OVERRIDE; |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 20 | virtual bool shouldSkip() const SK_OVERRIDE; |
| 21 | virtual SkString name() const SK_OVERRIDE { return fName; } |
| 22 | |
| 23 | private: |
| 24 | SkAutoTDelete<SkBenchmark> fBench; |
| 25 | const SkString fName; |
| 26 | }; |
| 27 | |
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 28 | class CpuBenchTask : public CpuTask { |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 29 | public: |
| 30 | CpuBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Factory, SkColorType); |
| 31 | |
| 32 | virtual void draw() SK_OVERRIDE; |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 33 | virtual bool shouldSkip() const SK_OVERRIDE; |
| 34 | virtual SkString name() const SK_OVERRIDE { return fName; } |
| 35 | |
| 36 | private: |
| 37 | SkAutoTDelete<SkBenchmark> fBench; |
| 38 | const SkString fName; |
| 39 | const SkColorType fColorType; |
| 40 | }; |
| 41 | |
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 42 | class GpuBenchTask : public GpuTask { |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 43 | public: |
| 44 | GpuBenchTask(const char* config, |
| 45 | Reporter*, |
| 46 | TaskRunner*, |
| 47 | BenchRegistry::Factory, |
| 48 | GrContextFactory::GLContextType, |
| 49 | int sampleCount); |
| 50 | |
commit-bot@chromium.org | ef57b7e | 2014-02-28 20:31:31 +0000 | [diff] [blame] | 51 | virtual void draw(GrContextFactory*) SK_OVERRIDE; |
commit-bot@chromium.org | 38aeb0f | 2014-02-26 23:01:57 +0000 | [diff] [blame] | 52 | virtual bool shouldSkip() const SK_OVERRIDE; |
| 53 | virtual SkString name() const SK_OVERRIDE { return fName; } |
| 54 | |
| 55 | private: |
| 56 | SkAutoTDelete<SkBenchmark> fBench; |
| 57 | const SkString fName; |
| 58 | const GrContextFactory::GLContextType fContextType; |
| 59 | int fSampleCount; |
| 60 | }; |
| 61 | |
| 62 | } // namespace DM |
| 63 | |
| 64 | #endif // DMBenchTask_DEFINED |