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

Unified Diff: dm/DM.cpp

Issue 798383003: Add more filetypes to DM's image tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 bda9995e35d20cfec908a126b7b2a30c62bacd0c..aa846017281c2b2a42d44e949e0c0556506c22d1 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -249,8 +249,25 @@ int dm_main() {
SkTArray<SkString> images;
if (!FLAGS_images.isEmpty()) {
- const char* suffixes[] = { "bmp", "gif", "jpg", "png", "webp", "ktx", "astc" };
- find_files(FLAGS_images[0], suffixes, SK_ARRAY_COUNT(suffixes), &images);
+ const char* suffixes[] = { "bmp", "gif", "jpg", "jpeg", "png", "webp",
mtklein 2014/12/15 16:06:32 Why don't we just write const char* suffixes[] =
scroggo 2014/12/15 16:16:00 We could do that. (We did it in skimage.) The adva
+ "ktx", "astc", "wbmp", "ico" };
+ const size_t count = SK_ARRAY_COUNT(suffixes);
+ find_files(FLAGS_images[0], suffixes, count, &images);
+ // Also check for the capitalized versions.
+ // Note: capSuffixes does not grow or shrink, so we can continue to use
+ // "count".
+ SkTArray<const char*> capSuffixes(suffixes, count);
+ for (size_t i = 0; i < count; ++i) {
+ char* cap = SkStrDup(capSuffixes[i]);
+ for (size_t j = 0; j < strlen(cap); ++j) {
+ cap[j] = toupper(cap[j]);
+ }
+ capSuffixes[i] = cap;
+ }
+ find_files(FLAGS_images[0], capSuffixes.begin(), count, &images);
+ for (size_t i = 0; i < count; ++i) {
+ sk_free(const_cast<char*>(capSuffixes[i]));
+ }
}
SkDebugf("%d GMs x %d configs, %d tests, %d pictures, %d images\n",
« 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