2013-10-16 13:02:15 +00:00
|
|
|
#ifndef DMReplayTask_DEFINED
|
|
|
|
#define DMReplayTask_DEFINED
|
|
|
|
|
|
|
|
#include "DMTask.h"
|
|
|
|
#include "SkBitmap.h"
|
|
|
|
#include "SkString.h"
|
|
|
|
#include "SkTemplates.h"
|
|
|
|
#include "gm.h"
|
|
|
|
|
2013-10-16 19:13:38 +00:00
|
|
|
// Records a GM through an SkPicture, draws it, and compares against the reference bitmap.
|
2013-10-16 13:02:15 +00:00
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
|
|
|
class ReplayTask : public Task {
|
|
|
|
|
|
|
|
public:
|
2013-10-21 18:40:25 +00:00
|
|
|
ReplayTask(const Task& parent,
|
2013-10-16 13:02:15 +00:00
|
|
|
skiagm::GM*,
|
2013-10-16 19:13:38 +00:00
|
|
|
SkBitmap reference);
|
2013-10-16 13:02:15 +00:00
|
|
|
|
|
|
|
virtual void draw() SK_OVERRIDE;
|
|
|
|
virtual bool usesGpu() const SK_OVERRIDE { return false; }
|
|
|
|
virtual bool shouldSkip() const SK_OVERRIDE;
|
|
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
const SkString fName;
|
|
|
|
SkAutoTDelete<skiagm::GM> fGM;
|
2013-10-16 19:13:38 +00:00
|
|
|
const SkBitmap fReference;
|
2013-10-16 13:02:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#endif // DMReplayTask_DEFINED
|