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

Unified Diff: dm/DM.cpp

Issue 1332903002: DM: add --key and --properties to PNG description field. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 66cc272f2475d25264be812596b9f5d13a732035..8c31fa6a918782e64c89b1496a1191023bc044c9 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -674,12 +674,23 @@ static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) {
return false;
}
+ SkString description;
+ description.append("Key: ");
+ for (int i = 0; i < FLAGS_key.count(); i++) {
+ description.appendf("%s ", FLAGS_key[i]);
+ }
+ description.append("Properties: ");
+ for (int i = 0; i < FLAGS_properties.count(); i++) {
+ description.appendf("%s ", FLAGS_properties[i]);
+ }
+ description.appendf("MD5: %s", md5);
+
png_text text[2];
text[0].key = (png_charp)"Author";
text[0].text = (png_charp)"DM dump_png()";
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
text[1].key = (png_charp)"Description";
- text[1].text = (png_charp)md5;
+ text[1].text = (png_charp)description.c_str();
text[1].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text(png, info, text, 2);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698