| 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" |
| 11 #include "DMSrcSinkAndroid.h" | 11 #include "DMSrcSinkAndroid.h" |
| 12 #include "ProcStats.h" | 12 #include "ProcStats.h" |
| 13 #include "Resources.h" | 13 #include "Resources.h" |
| 14 #include "SkBBHFactory.h" | 14 #include "SkBBHFactory.h" |
| 15 #include "SkChecksum.h" | 15 #include "SkChecksum.h" |
| 16 #include "SkCodec.h" | 16 #include "SkCodec.h" |
| 17 #include "SkColorPriv.h" | 17 #include "SkColorPriv.h" |
| 18 #include "SkColorSpace.h" |
| 18 #include "SkCommonFlags.h" | 19 #include "SkCommonFlags.h" |
| 19 #include "SkCommonFlagsConfig.h" | 20 #include "SkCommonFlagsConfig.h" |
| 20 #include "SkData.h" | 21 #include "SkData.h" |
| 21 #include "SkFontMgr.h" | 22 #include "SkFontMgr.h" |
| 22 #include "SkGraphics.h" | 23 #include "SkGraphics.h" |
| 23 #include "SkHalf.h" | 24 #include "SkHalf.h" |
| 24 #include "SkMD5.h" | 25 #include "SkMD5.h" |
| 25 #include "SkMutex.h" | 26 #include "SkMutex.h" |
| 26 #include "SkOSFile.h" | 27 #include "SkOSFile.h" |
| 27 #include "SkPM4fPriv.h" | 28 #include "SkPM4fPriv.h" |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 if (ext && brd_supported(ext+1)) { | 724 if (ext && brd_supported(ext+1)) { |
| 724 push_brd_srcs(image); | 725 push_brd_srcs(image); |
| 725 } | 726 } |
| 726 } | 727 } |
| 727 | 728 |
| 728 SkTArray<SkString> colorImages; | 729 SkTArray<SkString> colorImages; |
| 729 if (!CollectImages(FLAGS_colorImages, &colorImages)) { | 730 if (!CollectImages(FLAGS_colorImages, &colorImages)) { |
| 730 return false; | 731 return false; |
| 731 } | 732 } |
| 732 | 733 |
| 734 // Load the dstSpace. This particular dst is fairly similar to Adobe RGB. |
| 735 SkAutoTUnref<SkData> data(SkData::NewFromFileName( |
| 736 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str())); |
| 737 sk_sp<SkColorSpace> dstSpace = SkColorSpace::NewICC(data->data(), data->size
()); |
| 738 SkASSERT(dstSpace); |
| 739 |
| 733 for (auto colorImage : colorImages) { | 740 for (auto colorImage : colorImages) { |
| 734 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel
ine_Mode); | 741 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel
ine_Mode, nullptr); |
| 735 push_src("image", "color_codec_baseline", src); | 742 push_src("image", "color_codec_baseline", src); |
| 743 |
| 744 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kDst_HPZR30w_Mode, ds
tSpace); |
| 745 push_src("image", "color_codec_HPZR30w", src); |
| 736 } | 746 } |
| 737 | 747 |
| 738 return true; | 748 return true; |
| 739 } | 749 } |
| 740 | 750 |
| 741 static void push_sink(const SkCommandLineConfig& config, Sink* s) { | 751 static void push_sink(const SkCommandLineConfig& config, Sink* s) { |
| 742 SkAutoTDelete<Sink> sink(s); | 752 SkAutoTDelete<Sink> sink(s); |
| 743 | 753 |
| 744 // Try a simple Src as a canary. If it fails, skip this sink. | 754 // Try a simple Src as a canary. If it fails, skip this sink. |
| 745 struct : public Src { | 755 struct : public Src { |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 #endif | 1390 #endif |
| 1381 } | 1391 } |
| 1382 } // namespace skiatest | 1392 } // namespace skiatest |
| 1383 | 1393 |
| 1384 #if !defined(SK_BUILD_FOR_IOS) | 1394 #if !defined(SK_BUILD_FOR_IOS) |
| 1385 int main(int argc, char** argv) { | 1395 int main(int argc, char** argv) { |
| 1386 SkCommandLineFlags::Parse(argc, argv); | 1396 SkCommandLineFlags::Parse(argc, argv); |
| 1387 return dm_main(); | 1397 return dm_main(); |
| 1388 } | 1398 } |
| 1389 #endif | 1399 #endif |
| OLD | NEW |