Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: dm/DMWriteTask.h

Issue 702513003: Separate JSON functions from DMWriteTask. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Modify comment to be more accurate. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/DMJsonWriter.cpp ('k') | dm/DMWriteTask.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef DMWriteTask_DEFINED 1 #ifndef DMWriteTask_DEFINED
2 #define DMWriteTask_DEFINED 2 #define DMWriteTask_DEFINED
3 3
4 #include "DMTask.h" 4 #include "DMTask.h"
5 #include "SkBitmap.h" 5 #include "SkBitmap.h"
6 #include "SkJSONCPP.h"
7 #include "SkStream.h" 6 #include "SkStream.h"
8 #include "SkString.h" 7 #include "SkString.h"
9 #include "SkTArray.h" 8 #include "SkTArray.h"
10 9
11 10
12 // Writes a bitmap to a file. 11 // Writes a bitmap to a file.
13 12
14 namespace DM { 13 namespace DM {
15 14
16 class WriteTask : public CpuTask { 15 class WriteTask : public CpuTask {
17 16
18 public: 17 public:
19 WriteTask(const Task& parent, // WriteTask must be a child task. 18 WriteTask(const Task& parent, // WriteTask must be a child task.
20 const char* sourceType, // E.g. "GM", "SKP". For humans. 19 const char* sourceType, // E.g. "GM", "SKP". For humans.
21 SkBitmap bitmap); // Bitmap to encode to PNG and write to d isk. 20 SkBitmap bitmap); // Bitmap to encode to PNG and write to d isk.
22 21
23 // Takes ownership of SkStreamAsset 22 // Takes ownership of SkStreamAsset
24 WriteTask(const Task& parent, // WriteTask must be a child task. 23 WriteTask(const Task& parent, // WriteTask must be a child task.
25 const char* sourceType, // E.g. "GM", "SKP". For humans. 24 const char* sourceType, // E.g. "GM", "SKP". For humans.
26 SkStreamAsset* data, // Pre-encoded data to write to disk. 25 SkStreamAsset* data, // Pre-encoded data to write to disk.
27 const char* ext); // File extension. 26 const char* ext); // File extension.
28 27
29 virtual void draw() SK_OVERRIDE; 28 virtual void draw() SK_OVERRIDE;
30 virtual bool shouldSkip() const SK_OVERRIDE; 29 virtual bool shouldSkip() const SK_OVERRIDE;
31 virtual SkString name() const SK_OVERRIDE; 30 virtual SkString name() const SK_OVERRIDE;
32 31
33 static void DumpJson();
34
35 private: 32 private:
36 SkTArray<SkString> fSuffixes; 33 SkTArray<SkString> fSuffixes;
37 const SkString fBaseName; 34 const SkString fBaseName;
38 const SkString fSourceType; 35 const SkString fSourceType;
39 const SkBitmap fBitmap; 36 const SkBitmap fBitmap;
40 SkAutoTDelete<SkStreamAsset> fData; 37 SkAutoTDelete<SkStreamAsset> fData;
41 const char* fExtension; 38 const char* fExtension;
42 39
43 void makeDirOrFail(SkString dir); 40 void makeDirOrFail(SkString dir);
44 }; 41 };
45 42
46 } // namespace DM 43 } // namespace DM
47 44
48 #endif // DMWriteTask_DEFINED 45 #endif // DMWriteTask_DEFINED
OLDNEW
« no previous file with comments | « dm/DMJsonWriter.cpp ('k') | dm/DMWriteTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698