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

Unified Diff: dm/DMWriteTask.cpp

Issue 288823002: DM: tweaks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: oops Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMWriteTask.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « dm/DMWriteTask.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698