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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 if (ext && brd_supported(ext+1)) { | 717 if (ext && brd_supported(ext+1)) { |
718 push_brd_srcs(image); | 718 push_brd_srcs(image); |
719 } | 719 } |
720 } | 720 } |
721 | 721 |
722 SkTArray<SkString> colorImages; | 722 SkTArray<SkString> colorImages; |
723 if (!CollectImages(FLAGS_colorImages, &colorImages)) { | 723 if (!CollectImages(FLAGS_colorImages, &colorImages)) { |
724 return false; | 724 return false; |
725 } | 725 } |
726 | 726 |
| 727 // Load the dstSpace. This particular dst is fairly similar to Adobe RGB. |
| 728 SkAutoTUnref<SkData> data(SkData::NewFromFileName( |
| 729 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str())); |
| 730 sk_sp<SkColorSpace> dstSpace = SkColorSpace::NewICC(data->data(), data->size
()); |
| 731 SkASSERT(dstSpace); |
| 732 |
727 for (auto colorImage : colorImages) { | 733 for (auto colorImage : colorImages) { |
728 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel
ine_Mode); | 734 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel
ine_Mode, nullptr); |
729 push_src("image", "color_codec_baseline", src); | 735 push_src("image", "color_codec_baseline", src); |
730 | 736 |
731 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kDst_HPZR30w_Mode); | 737 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kDst_HPZR30w_Mode, ds
tSpace); |
732 push_src("image", "color_codec_HPZR30w", src); | 738 push_src("image", "color_codec_HPZR30w", src); |
733 | |
734 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kQCMS_HPZR30w_Mode); | |
735 push_src("image", "color_codec_QCMS_HPZR30w", src); | |
736 } | 739 } |
737 | 740 |
738 return true; | 741 return true; |
739 } | 742 } |
740 | 743 |
741 static void push_sink(const SkCommandLineConfig& config, Sink* s) { | 744 static void push_sink(const SkCommandLineConfig& config, Sink* s) { |
742 SkAutoTDelete<Sink> sink(s); | 745 SkAutoTDelete<Sink> sink(s); |
743 | 746 |
744 // Try a simple Src as a canary. If it fails, skip this sink. | 747 // Try a simple Src as a canary. If it fails, skip this sink. |
745 struct : public Src { | 748 struct : public Src { |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 #endif | 1389 #endif |
1387 } | 1390 } |
1388 } // namespace skiatest | 1391 } // namespace skiatest |
1389 | 1392 |
1390 #if !defined(SK_BUILD_FOR_IOS) | 1393 #if !defined(SK_BUILD_FOR_IOS) |
1391 int main(int argc, char** argv) { | 1394 int main(int argc, char** argv) { |
1392 SkCommandLineFlags::Parse(argc, argv); | 1395 SkCommandLineFlags::Parse(argc, argv); |
1393 return dm_main(); | 1396 return dm_main(); |
1394 } | 1397 } |
1395 #endif | 1398 #endif |
OLD | NEW |