2014-02-26 23:01:57 +00:00
|
|
|
#ifndef DMBenchTask_DEFINED
|
|
|
|
#define DMBenchTask_DEFINED
|
|
|
|
|
|
|
|
#include "DMReporter.h"
|
|
|
|
#include "DMTask.h"
|
|
|
|
#include "DMTaskRunner.h"
|
|
|
|
#include "SkBenchmark.h"
|
|
|
|
#include "SkString.h"
|
|
|
|
#include "SkTemplates.h"
|
|
|
|
|
|
|
|
// Tasks that run an SkBenchmark once as a check that it doesn't crash.
|
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
2014-02-28 20:31:31 +00:00
|
|
|
class NonRenderingBenchTask : public CpuTask {
|
2014-02-26 23:01:57 +00:00
|
|
|
public:
|
|
|
|
NonRenderingBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Factory);
|
|
|
|
|
|
|
|
virtual void draw() SK_OVERRIDE;
|
|
|
|
virtual bool shouldSkip() const SK_OVERRIDE;
|
|
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkAutoTDelete<SkBenchmark> fBench;
|
|
|
|
const SkString fName;
|
|
|
|
};
|
|
|
|
|
2014-02-28 20:31:31 +00:00
|
|
|
class CpuBenchTask : public CpuTask {
|
2014-02-26 23:01:57 +00:00
|
|
|
public:
|
|
|
|
CpuBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Factory, SkColorType);
|
|
|
|
|
|
|
|
virtual void draw() SK_OVERRIDE;
|
|
|
|
virtual bool shouldSkip() const SK_OVERRIDE;
|
|
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkAutoTDelete<SkBenchmark> fBench;
|
|
|
|
const SkString fName;
|
|
|
|
const SkColorType fColorType;
|
|
|
|
};
|
|
|
|
|
2014-02-28 20:31:31 +00:00
|
|
|
class GpuBenchTask : public GpuTask {
|
2014-02-26 23:01:57 +00:00
|
|
|
public:
|
|
|
|
GpuBenchTask(const char* config,
|
|
|
|
Reporter*,
|
|
|
|
TaskRunner*,
|
|
|
|
BenchRegistry::Factory,
|
|
|
|
GrContextFactory::GLContextType,
|
|
|
|
int sampleCount);
|
|
|
|
|
2014-02-28 20:31:31 +00:00
|
|
|
virtual void draw(GrContextFactory*) SK_OVERRIDE;
|
2014-02-26 23:01:57 +00:00
|
|
|
virtual bool shouldSkip() const SK_OVERRIDE;
|
|
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkAutoTDelete<SkBenchmark> fBench;
|
|
|
|
const SkString fName;
|
|
|
|
const GrContextFactory::GLContextType fContextType;
|
|
|
|
int fSampleCount;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#endif // DMBenchTask_DEFINED
|