2013-11-26 18:52:31 +00:00
|
|
|
#ifndef DMChecksumTask_DEFINED
|
|
|
|
#define DMChecksumTask_DEFINED
|
2013-10-16 13:02:15 +00:00
|
|
|
|
|
|
|
#include "DMTask.h"
|
|
|
|
#include "SkBitmap.h"
|
|
|
|
#include "SkString.h"
|
|
|
|
#include "gm_expectations.h"
|
|
|
|
|
|
|
|
namespace DM {
|
|
|
|
|
2013-11-26 18:52:31 +00:00
|
|
|
// ChecksumTask compares an SkBitmap against some Expectations.
|
|
|
|
// Moving this off the GPU threadpool is a nice (~30%) runtime win.
|
|
|
|
class ChecksumTask : public Task {
|
2013-10-16 13:02:15 +00:00
|
|
|
public:
|
2013-11-26 18:52:31 +00:00
|
|
|
ChecksumTask(const Task& parent, skiagm::Expectations, SkBitmap);
|
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 { return false; }
|
|
|
|
virtual SkString name() const SK_OVERRIDE { return fName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
const SkString fName;
|
|
|
|
const skiagm::Expectations fExpectations;
|
|
|
|
const SkBitmap fBitmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DM
|
|
|
|
|
2013-11-26 18:52:31 +00:00
|
|
|
#endif // DMChecksumTask_DEFINED
|