Chromium Code Reviews| Index: dm/DM.cpp |
| diff --git a/dm/DM.cpp b/dm/DM.cpp |
| index 256014e5daabc979a0339b36086a230744700216..575dc8330bde0bc6a3e10fbeb30d6a994a7a5dd9 100644 |
| --- a/dm/DM.cpp |
| +++ b/dm/DM.cpp |
| @@ -42,6 +42,10 @@ DEFINE_string(blacklist, "", |
| DEFINE_string2(readPath, r, "", "If set check for equality with golden results in this directory."); |
| +DEFINE_string(uninterestingHashesFile, "", |
| + "File containing a list of uninteresting hashes. If a result hashes to something in " |
| + "this list, no image is written for that result."); |
| + |
| __SK_FORCE_IMAGE_DECODER_LINKING; |
| using namespace DM; |
| @@ -137,6 +141,21 @@ static void gather_gold() { |
| /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ |
| +static SkTHashSet<SkString> gUninterestingHashes; |
| + |
| +static void gather_uninteresting_hashes() { |
| + if (!FLAGS_uninterestingHashesFile.isEmpty()) { |
| + SkAutoTUnref<SkData> data(SkData::NewFromFileName(FLAGS_FLAGS_uninterestingHashesFile[0])); |
|
mtklein
2015/04/03 21:01:07
I think you may have meant FLAGS_FLAGS_FLAGS_FLAGS
borenet
2015/04/03 21:09:09
MOAR_MOAR_MOAR
|
| + SkTArray<SkString> hashes; |
| + SkStrSplit((const char*)data->data(), "\n", &hashes); |
| + for (const SkString& hash : hashes) { |
| + gUninterestingHashes.add(hash); |
| + } |
| + } |
| +} |
| + |
| +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ |
| + |
| template <typename T> |
| struct Tagged : public SkAutoTDelete<T> { |
| const char* tag; |
| @@ -435,7 +454,7 @@ struct Task { |
| FLAGS_readPath[0])); |
| } |
| - if (!FLAGS_writePath.isEmpty()) { |
| + if (!FLAGS_writePath.isEmpty() && !gUninterestingHashes.contains(md5)) { |
| const char* ext = task->sink->fileExtension(); |
| if (data->getLength()) { |
| WriteToDisk(*task, md5, ext, data, data->getLength(), NULL); |
| @@ -625,6 +644,7 @@ int dm_main() { |
| start_keepalive(); |
| gather_gold(); |
| + gather_uninteresting_hashes(); |
| gather_srcs(); |
| gather_sinks(); |