OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 }); | 1010 }); |
1011 } | 1011 } |
1012 done(task.sink.tag.c_str(), task.src.tag.c_str(), task.src.options.c_str
(), name.c_str()); | 1012 done(task.sink.tag.c_str(), task.src.tag.c_str(), task.src.options.c_str
(), name.c_str()); |
1013 } | 1013 } |
1014 | 1014 |
1015 static void WriteToDisk(const Task& task, | 1015 static void WriteToDisk(const Task& task, |
1016 SkString md5, | 1016 SkString md5, |
1017 const char* ext, | 1017 const char* ext, |
1018 SkStream* data, size_t len, | 1018 SkStream* data, size_t len, |
1019 const SkBitmap* bitmap) { | 1019 const SkBitmap* bitmap) { |
| 1020 bool gammaCorrect = false; |
| 1021 if (bitmap) { |
| 1022 gammaCorrect = bitmap->profileType() == kSRGB_SkColorProfileType |
| 1023 || bitmap-> colorType() == kRGBA_F16_SkColorType; |
| 1024 } |
| 1025 |
1020 JsonWriter::BitmapResult result; | 1026 JsonWriter::BitmapResult result; |
1021 result.name = task.src->name(); | 1027 result.name = task.src->name(); |
1022 result.config = task.sink.tag; | 1028 result.config = task.sink.tag; |
1023 result.sourceType = task.src.tag; | 1029 result.sourceType = task.src.tag; |
1024 result.sourceOptions = task.src.options; | 1030 result.sourceOptions = task.src.options; |
1025 result.ext = ext; | 1031 result.ext = ext; |
| 1032 result.gammaCorrect = gammaCorrect; |
1026 result.md5 = md5; | 1033 result.md5 = md5; |
1027 JsonWriter::AddBitmapResult(result); | 1034 JsonWriter::AddBitmapResult(result); |
1028 | 1035 |
1029 // If an MD5 is uninteresting, we want it noted in the JSON file, | 1036 // If an MD5 is uninteresting, we want it noted in the JSON file, |
1030 // but don't want to dump it out as a .png (or whatever ext is). | 1037 // but don't want to dump it out as a .png (or whatever ext is). |
1031 if (gUninterestingHashes.contains(md5)) { | 1038 if (gUninterestingHashes.contains(md5)) { |
1032 return; | 1039 return; |
1033 } | 1040 } |
1034 | 1041 |
1035 const char* dir = FLAGS_writePath[0]; | 1042 const char* dir = FLAGS_writePath[0]; |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 Reporter* reporter, | 1342 Reporter* reporter, |
1336 GrContextFactory* fac
tory); | 1343 GrContextFactory* fac
tory); |
1337 } // namespace skiatest | 1344 } // namespace skiatest |
1338 | 1345 |
1339 #if !defined(SK_BUILD_FOR_IOS) | 1346 #if !defined(SK_BUILD_FOR_IOS) |
1340 int main(int argc, char** argv) { | 1347 int main(int argc, char** argv) { |
1341 SkCommandLineFlags::Parse(argc, argv); | 1348 SkCommandLineFlags::Parse(argc, argv); |
1342 return dm_main(); | 1349 return dm_main(); |
1343 } | 1350 } |
1344 #endif | 1351 #endif |
OLD | NEW |