OLD | NEW |
1 #include "DMWriteTask.h" | 1 #include "DMWriteTask.h" |
2 | 2 |
3 #include "DMUtil.h" | 3 #include "DMUtil.h" |
4 #include "SkColorPriv.h" | 4 #include "SkColorPriv.h" |
5 #include "SkCommonFlags.h" | 5 #include "SkCommonFlags.h" |
6 #include "SkImageEncoder.h" | 6 #include "SkImageEncoder.h" |
7 #include "SkMallocPixelRef.h" | 7 #include "SkMallocPixelRef.h" |
8 #include "SkStream.h" | 8 #include "SkStream.h" |
9 #include "SkString.h" | 9 #include "SkString.h" |
10 | 10 |
11 DEFINE_string2(writePath, w, "", "If set, write GMs here as .pngs."); | |
12 DEFINE_bool(writePngOnly, false, "If true, don't encode raw bitmap after .png da
ta. " | 11 DEFINE_bool(writePngOnly, false, "If true, don't encode raw bitmap after .png da
ta. " |
13 "This means -r won't work, but skdiff will stil
l work fine."); | 12 "This means -r won't work, but skdiff will stil
l work fine."); |
14 | 13 |
15 namespace DM { | 14 namespace DM { |
16 | 15 |
17 // Splits off the last N suffixes of name (splitting on _) and appends them to o
ut. | 16 // Splits off the last N suffixes of name (splitting on _) and appends them to o
ut. |
18 // Returns the total number of characters consumed. | 17 // Returns the total number of characters consumed. |
19 static int split_suffixes(int N, const char* name, SkTArray<SkString>* out) { | 18 static int split_suffixes(int N, const char* name, SkTArray<SkString>* out) { |
20 SkTArray<SkString> split; | 19 SkTArray<SkString> split; |
21 SkStrSplit(name, "_", &split); | 20 SkStrSplit(name, "_", &split); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 const SkString path = path_to_expected_image(fRoot, task); | 190 const SkString path = path_to_expected_image(fRoot, task); |
192 SkBitmap expected; | 191 SkBitmap expected; |
193 if (!PngAndRaw::Decode(path.c_str(), bitmap.info(), &expected)) { | 192 if (!PngAndRaw::Decode(path.c_str(), bitmap.info(), &expected)) { |
194 return false; | 193 return false; |
195 } | 194 } |
196 | 195 |
197 return BitmapsEqual(expected, bitmap); | 196 return BitmapsEqual(expected, bitmap); |
198 } | 197 } |
199 | 198 |
200 } // namespace DM | 199 } // namespace DM |
OLD | NEW |