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-30 20:45:28 +00:00
|
|
|
ReplayTask(const Task& parent, // ReplayTask must be a child task. Pass its parent here.
|
2013-12-02 13:50:38 +00:00
|
|
|
skiagm::GM*, // GM to run through a picture. Takes ownership.
|
|
|
|
SkBitmap reference, // Bitmap to compare picture replay results to.
|
2013-10-30 20:45:28 +00:00
|
|
|
bool useRTree); // Record with an RTree?
|
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-30 20:45:28 +00:00
|
|
|
const bool fUseRTree;
|
2013-10-16 13:02:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#endif // DMReplayTask_DEFINED
|