Index: dm/DMWriteTask.cpp |
diff --git a/dm/DMWriteTask.cpp b/dm/DMWriteTask.cpp |
index cfac4152e384e8b961743829bc2af1890aeb6cd2..7c9bb628a71cec1afa9128b95672e0b6613d8cac 100644 |
--- a/dm/DMWriteTask.cpp |
+++ b/dm/DMWriteTask.cpp |
@@ -9,6 +9,8 @@ |
#include "SkString.h" |
DEFINE_string2(writePath, w, "", "If set, write GMs here as .pngs."); |
+DEFINE_bool(writePngOnly, false, "If true, don't encode raw bitmap after .png data. " |
+ "This means -r won't work, but skdiff will still work fine."); |
namespace DM { |
@@ -26,16 +28,12 @@ static int split_suffixes(int N, const char* name, SkTArray<SkString>* out) { |
return consumed; |
} |
-WriteTask::WriteTask(const Task& parent, SkBitmap bitmap, Mode mode) |
+WriteTask::WriteTask(const Task& parent, SkBitmap bitmap) |
: CpuTask(parent), fBitmap(bitmap) { |
- if (mode == kVerbatim_Mode) { |
- fGmName.set(parent.name()); |
- } else { |
- const int suffixes = parent.depth() + 1; |
- const SkString& name = parent.name(); |
- const int totalSuffixLength = split_suffixes(suffixes, name.c_str(), &fSuffixes); |
- fGmName.set(name.c_str(), name.size()-totalSuffixLength); |
- } |
+ const int suffixes = parent.depth() + 1; |
+ const SkString& name = parent.name(); |
+ const int totalSuffixLength = split_suffixes(suffixes, name.c_str(), &fSuffixes); |
+ fGmName.set(name.c_str(), name.size()-totalSuffixLength); |
} |
void WriteTask::makeDirOrFail(SkString dir) { |
@@ -61,6 +59,9 @@ struct PngAndRaw { |
SkDebugf("Can't encode a PNG.\n"); |
return false; |
} |
+ if (FLAGS_writePngOnly) { |
+ return true; |
+ } |
// Pad out so the raw pixels start 4-byte aligned. |
const uint32_t maxPadding = 0; |