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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 2194903002: Fix various SkColorSpace bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use switch statement in nonstandard struct Created 4 years, 4 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 | « bench/ColorCodecBench.cpp ('k') | resources/icc_profiles/HP_Z32x.icc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 return SkStringPrintf("Couldn't read %s.", fPath.c_str()); 862 return SkStringPrintf("Couldn't read %s.", fPath.c_str());
863 } 863 }
864 864
865 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); 865 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
866 if (nullptr == codec.get()) { 866 if (nullptr == codec.get()) {
867 return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str()); 867 return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
868 } 868 }
869 869
870 // Load the dst ICC profile. This particular dst is fairly similar to Adobe RGB. 870 // Load the dst ICC profile. This particular dst is fairly similar to Adobe RGB.
871 sk_sp<SkData> dstData = SkData::MakeFromFileName( 871 sk_sp<SkData> dstData = SkData::MakeFromFileName(
872 GetResourcePath("monitor_profiles/HP_ZR30w.icc").c_str()); 872 GetResourcePath("icc_profiles/HP_ZR30w.icc").c_str());
873 if (!dstData) { 873 if (!dstData) {
874 return "Cannot read monitor profile. Is the resource path set correctly ?"; 874 return "Cannot read monitor profile. Is the resource path set correctly ?";
875 } 875 }
876 876
877 sk_sp<SkColorSpace> dstSpace = nullptr; 877 sk_sp<SkColorSpace> dstSpace = nullptr;
878 if (kDst_sRGB_Mode == fMode) { 878 if (kDst_sRGB_Mode == fMode) {
879 dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 879 dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
880 } else if (kDst_HPZR30w_Mode == fMode) { 880 } else if (kDst_HPZR30w_Mode == fMode) {
881 dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); 881 dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size());
882 } 882 }
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 skr.visit(i, drawsAsSingletonPictures); 1556 skr.visit(i, drawsAsSingletonPictures);
1557 } 1557 }
1558 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); 1558 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture());
1559 1559
1560 canvas->drawPicture(macroPic); 1560 canvas->drawPicture(macroPic);
1561 return check_against_reference(bitmap, src, fSink); 1561 return check_against_reference(bitmap, src, fSink);
1562 }); 1562 });
1563 } 1563 }
1564 1564
1565 } // namespace DM 1565 } // namespace DM
OLDNEW
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | resources/icc_profiles/HP_Z32x.icc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698