1a90c6803865766d28e92091f56f718f5e41fe80fcommit-bot@chromium.org#ifndef DMQuiltTask_DEFINED
2a90c6803865766d28e92091f56f718f5e41fe80fcommit-bot@chromium.org#define DMQuiltTask_DEFINED
309f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
409f25791091db15a61083169cfda9feda0e653f6mtklein@google.com#include "DMTask.h"
509f25791091db15a61083169cfda9feda0e653f6mtklein@google.com#include "SkBitmap.h"
609f25791091db15a61083169cfda9feda0e653f6mtklein@google.com#include "SkString.h"
709f25791091db15a61083169cfda9feda0e653f6mtklein@google.com#include "SkTemplates.h"
809f25791091db15a61083169cfda9feda0e653f6mtklein@google.com#include "gm.h"
909f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
1009f25791091db15a61083169cfda9feda0e653f6mtklein@google.com// Records a GM through an SkPicture, draws it in tiles, and compares against the reference bitmap.
1109f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
1209f25791091db15a61083169cfda9feda0e653f6mtklein@google.comnamespace DM {
1309f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
14a90c6803865766d28e92091f56f718f5e41fe80fcommit-bot@chromium.orgclass QuiltTask : public CpuTask {
1509f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
1609f25791091db15a61083169cfda9feda0e653f6mtklein@google.compublic:
17a90c6803865766d28e92091f56f718f5e41fe80fcommit-bot@chromium.org    QuiltTask(const Task& parent,   // QuiltTask must be a child task.  Pass its parent here.
18a90c6803865766d28e92091f56f718f5e41fe80fcommit-bot@chromium.org                skiagm::GM*,          // GM to run through a picture.  Takes ownership.
19a90c6803865766d28e92091f56f718f5e41fe80fcommit-bot@chromium.org                SkBitmap reference);  // Bitmap to compare picture replay results to.
2009f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
2109f25791091db15a61083169cfda9feda0e653f6mtklein@google.com    virtual void draw() SK_OVERRIDE;
2209f25791091db15a61083169cfda9feda0e653f6mtklein@google.com    virtual bool shouldSkip() const SK_OVERRIDE;
2309f25791091db15a61083169cfda9feda0e653f6mtklein@google.com    virtual SkString name() const SK_OVERRIDE { return fName; }
2409f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
2509f25791091db15a61083169cfda9feda0e653f6mtklein@google.comprivate:
2609f25791091db15a61083169cfda9feda0e653f6mtklein@google.com    const SkString fName;
2709f25791091db15a61083169cfda9feda0e653f6mtklein@google.com    SkAutoTDelete<skiagm::GM> fGM;
2809f25791091db15a61083169cfda9feda0e653f6mtklein@google.com    const SkBitmap fReference;
2909f25791091db15a61083169cfda9feda0e653f6mtklein@google.com};
3009f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
3109f25791091db15a61083169cfda9feda0e653f6mtklein@google.com}  // namespace DM
3209f25791091db15a61083169cfda9feda0e653f6mtklein@google.com
3309f25791091db15a61083169cfda9feda0e653f6mtklein@google.com#endif  // DMReplayTask_DEFINED
34