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

Side by Side Diff: dm/DM.cpp

Issue 1952063002: Create SkColorSpaceXform to handle color conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add private API to allow test code to access ICC data Created 4 years, 6 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
733 for (auto colorImage : colorImages) { 727 for (auto colorImage : colorImages) {
734 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel ine_Mode, nullptr); 728 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel ine_Mode);
735 push_src("image", "color_codec_baseline", src); 729 push_src("image", "color_codec_baseline", src);
736 730
737 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kDst_HPZR30w_Mode, ds tSpace); 731 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kDst_HPZR30w_Mode);
738 push_src("image", "color_codec_HPZR30w", src); 732 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);
739 } 736 }
740 737
741 return true; 738 return true;
742 } 739 }
743 740
744 static void push_sink(const SkCommandLineConfig& config, Sink* s) { 741 static void push_sink(const SkCommandLineConfig& config, Sink* s) {
745 SkAutoTDelete<Sink> sink(s); 742 SkAutoTDelete<Sink> sink(s);
746 743
747 // Try a simple Src as a canary. If it fails, skip this sink. 744 // Try a simple Src as a canary. If it fails, skip this sink.
748 struct : public Src { 745 struct : public Src {
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 #endif 1380 #endif
1384 } 1381 }
1385 } // namespace skiatest 1382 } // namespace skiatest
1386 1383
1387 #if !defined(SK_BUILD_FOR_IOS) 1384 #if !defined(SK_BUILD_FOR_IOS)
1388 int main(int argc, char** argv) { 1385 int main(int argc, char** argv) {
1389 SkCommandLineFlags::Parse(argc, argv); 1386 SkCommandLineFlags::Parse(argc, argv);
1390 return dm_main(); 1387 return dm_main();
1391 } 1388 }
1392 #endif 1389 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698