blob: 82a26bc928bb7215c7ba1f03478c4b6c2f4a00ff [file] [log] [blame]
mtklein@google.coma7a9f372013-10-18 20:52:44 +00001#ifndef DMWriteTask_DEFINED
2#define DMWriteTask_DEFINED
3
4#include "DMTask.h"
5#include "SkBitmap.h"
6#include "SkString.h"
rmistry@google.comd6bab022013-12-02 13:50:38 +00007#include "SkTArray.h"
mtklein@google.coma7a9f372013-10-18 20:52:44 +00008
9// Writes a bitmap to a file.
10
11namespace DM {
12
13class WriteTask : public Task {
14
15public:
rmistry@google.comd6bab022013-12-02 13:50:38 +000016 WriteTask(const Task& parent, // WriteTask must be a child Task. Pass its parent here.
17 SkBitmap bitmap); // Bitmap to write.
mtklein@google.coma7a9f372013-10-18 20:52:44 +000018
19 virtual void draw() SK_OVERRIDE;
20 virtual bool usesGpu() const SK_OVERRIDE { return false; }
21 virtual bool shouldSkip() const SK_OVERRIDE;
22 virtual SkString name() const SK_OVERRIDE;
23
24private:
rmistry@google.comd6bab022013-12-02 13:50:38 +000025 SkTArray<SkString> fSuffixes;
mtklein@google.coma7a9f372013-10-18 20:52:44 +000026 SkString fGmName;
27 const SkBitmap fBitmap;
rmistry@google.comd6bab022013-12-02 13:50:38 +000028
29 void makeDirOrFail(SkString dir);
mtklein@google.coma7a9f372013-10-18 20:52:44 +000030};
31
32} // namespace DM
33
34#endif // DMWriteTask_DEFINED