OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |