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

Side by Side Diff: dm/DM.cpp

Issue 1995233003: Test color correction in DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 7 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"
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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (ext && brd_supported(ext+1)) { 717 if (ext && brd_supported(ext+1)) {
717 push_brd_srcs(image); 718 push_brd_srcs(image);
718 } 719 }
719 } 720 }
720 721
721 SkTArray<SkString> colorImages; 722 SkTArray<SkString> colorImages;
722 if (!CollectImages(FLAGS_colorImages, &colorImages)) { 723 if (!CollectImages(FLAGS_colorImages, &colorImages)) {
723 return false; 724 return false;
724 } 725 }
725 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
726 for (auto colorImage : colorImages) { 733 for (auto colorImage : colorImages) {
727 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel ine_Mode); 734 ColorCodecSrc* src = new ColorCodecSrc(colorImage, ColorCodecSrc::kBasel ine_Mode, nullptr);
728 push_src("image", "color_codec_baseline", src); 735 push_src("image", "color_codec_baseline", src);
736
737 src = new ColorCodecSrc(colorImage, ColorCodecSrc::kDst_HPZR30w_Mode, ds tSpace);
738 push_src("image", "color_codec_HPZR30w", src);
729 } 739 }
730 740
731 return true; 741 return true;
732 } 742 }
733 743
734 static void push_sink(const SkCommandLineConfig& config, Sink* s) { 744 static void push_sink(const SkCommandLineConfig& config, Sink* s) {
735 SkAutoTDelete<Sink> sink(s); 745 SkAutoTDelete<Sink> sink(s);
736 746
737 // 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.
738 struct : public Src { 748 struct : public Src {
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 #endif 1383 #endif
1374 } 1384 }
1375 } // namespace skiatest 1385 } // namespace skiatest
1376 1386
1377 #if !defined(SK_BUILD_FOR_IOS) 1387 #if !defined(SK_BUILD_FOR_IOS)
1378 int main(int argc, char** argv) { 1388 int main(int argc, char** argv) {
1379 SkCommandLineFlags::Parse(argc, argv); 1389 SkCommandLineFlags::Parse(argc, argv);
1380 return dm_main(); 1390 return dm_main();
1381 } 1391 }
1382 #endif 1392 #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