10a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#ifndef DMGpuTask_DEFINED
20a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#define DMGpuTask_DEFINED
30a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
4910f694aefb0b671dd8522a9afe9b6be645701c1Derek Sollenberger#include "DMExpectations.h"
50a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "DMReporter.h"
60a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "DMTask.h"
70a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "DMTaskRunner.h"
80a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "GrContextFactory.h"
90a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "SkBitmap.h"
100a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "SkString.h"
110a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "SkTemplates.h"
120a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#include "gm.h"
130a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
140a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger// This is the main entry point for drawing GMs with the GPU.
150a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
160a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenbergernamespace DM {
170a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
180a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenbergerclass GpuTask : public Task {
190a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenbergerpublic:
200a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    GpuTask(const char* name,
210a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger            Reporter*,
220a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger            TaskRunner*,
23910f694aefb0b671dd8522a9afe9b6be645701c1Derek Sollenberger            const Expectations&,
240a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger            skiagm::GMRegistry::Factory,
250a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger            SkBitmap::Config,
260a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger            GrContextFactory::GLContextType,
270a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger            int sampleCount);
280a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
290a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    virtual void draw() SK_OVERRIDE;
300a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    virtual bool usesGpu() const SK_OVERRIDE { return true; }
310a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    virtual bool shouldSkip() const SK_OVERRIDE;
320a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    virtual SkString name() const SK_OVERRIDE { return fName; }
330a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
340a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenbergerprivate:
350a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    SkAutoTDelete<skiagm::GM> fGM;
360a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    const SkString fName;
37910f694aefb0b671dd8522a9afe9b6be645701c1Derek Sollenberger    const Expectations& fExpectations;
380a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    const SkBitmap::Config fConfig;
390a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    const GrContextFactory::GLContextType fContextType;
400a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger    const int fSampleCount;
410a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger};
420a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
430a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger}  // namespace DM
440a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger
450a657bbc2c6fc9daf699942e023050536d5ec95fDerek Sollenberger#endif  // DMGpuTask_DEFINED
46