138aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#ifndef DMBenchTask_DEFINED
238aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#define DMBenchTask_DEFINED
338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
4f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina#include "Benchmark.h"
538aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#include "DMReporter.h"
638aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#include "DMTask.h"
738aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#include "DMTaskRunner.h"
838aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#include "SkString.h"
938aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#include "SkTemplates.h"
1038aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
11f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina// Tasks that run an Benchmark once as a check that it doesn't crash.
1238aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
1338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgnamespace DM {
1438aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
15ef57b7e65330d5f794a513630517907500f1c1d0commit-bot@chromium.orgclass NonRenderingBenchTask : public CpuTask {
1638aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgpublic:
1738aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    NonRenderingBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Factory);
1838aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
1938aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual void draw() SK_OVERRIDE;
2038aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual bool shouldSkip() const SK_OVERRIDE;
2138aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual SkString name() const SK_OVERRIDE { return fName; }
2238aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
2338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgprivate:
24f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina    SkAutoTDelete<Benchmark> fBench;
2538aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    const SkString fName;
2638aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org};
2738aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
28ef57b7e65330d5f794a513630517907500f1c1d0commit-bot@chromium.orgclass CpuBenchTask : public CpuTask {
2938aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgpublic:
3038aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    CpuBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Factory, SkColorType);
3138aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
3238aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual void draw() SK_OVERRIDE;
3338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual bool shouldSkip() const SK_OVERRIDE;
3438aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual SkString name() const SK_OVERRIDE { return fName; }
3538aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
3638aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgprivate:
37f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina    SkAutoTDelete<Benchmark> fBench;
3838aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    const SkString fName;
3938aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    const SkColorType fColorType;
4038aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org};
4138aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
42ef57b7e65330d5f794a513630517907500f1c1d0commit-bot@chromium.orgclass GpuBenchTask : public GpuTask {
4338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgpublic:
4438aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    GpuBenchTask(const char* config,
4538aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org                 Reporter*,
4638aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org                 TaskRunner*,
4738aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org                 BenchRegistry::Factory,
4838aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org                 GrContextFactory::GLContextType,
4938aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org                 int sampleCount);
5038aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
51ef57b7e65330d5f794a513630517907500f1c1d0commit-bot@chromium.org    virtual void draw(GrContextFactory*) SK_OVERRIDE;
5238aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual bool shouldSkip() const SK_OVERRIDE;
5338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    virtual SkString name() const SK_OVERRIDE { return fName; }
5438aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
5538aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.orgprivate:
56f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina    SkAutoTDelete<Benchmark> fBench;
5738aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    const SkString fName;
5838aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    const GrContextFactory::GLContextType fContextType;
5938aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org    int fSampleCount;
6038aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org};
6138aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
6238aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org}  // namespace DM
6338aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org
6438aeb0fd7a2bdab5e44531d96045dffe25c8e2b0commit-bot@chromium.org#endif // DMBenchTask_DEFINED
65