2013-10-28 19:51:26 +00:00
|
|
|
#ifndef DMPipeTask_DEFINED
|
|
|
|
#define DMPipeTask_DEFINED
|
|
|
|
|
|
|
|
#include "DMTask.h"
|
|
|
|
#include "SkBitmap.h"
|
|
|
|
#include "SkString.h"
|
|
|
|
#include "SkTemplates.h"
|
|
|
|
#include "gm.h"
|
|
|
|
|
|
|
|
// Sends a GM through a pipe, draws it, and compares against the reference bitmap.
|
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
2014-02-28 20:31:31 +00:00
|
|
|
class PipeTask : public CpuTask {
|
2013-10-28 19:51:26 +00:00
|
|
|
|
|
|
|
public:
|
2014-05-14 17:55:32 +00:00
|
|
|
enum Mode {
|
|
|
|
kInProcess_Mode,
|
|
|
|
kCrossProcess_Mode,
|
|
|
|
kSharedAddress_Mode,
|
|
|
|
};
|
|
|
|
|
2013-10-28 19:51:26 +00:00
|
|
|
PipeTask(const Task& parent, // PipeTask must be a child task. Pass its parent here.
|
|
|
|
skiagm::GM*, // GM to run through a pipe. Takes ownership.
|
|
|
|
SkBitmap reference, // Bitmap to compare pipe results to.
|
2014-05-14 17:55:32 +00:00
|
|
|
Mode);
|
2013-10-28 19:51:26 +00:00
|
|
|
|
|
|
|
virtual void draw() SK_OVERRIDE;
|
|
|
|
virtual bool shouldSkip() const SK_OVERRIDE;
|
|
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
const uint32_t fFlags;
|
|
|
|
const SkString fName;
|
|
|
|
SkAutoTDelete<skiagm::GM> fGM;
|
|
|
|
const SkBitmap fReference;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
|
|
|
#endif // DMPipeTask_DEFINED
|