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" |
11 #include "SkCodec.h" | 11 #include "SkCodec.h" |
12 #include "SkCodecImageGenerator.h" | 12 #include "SkCodecImageGenerator.h" |
13 #include "SkColorSpace.h" | 13 #include "SkColorSpace.h" |
14 #include "SkColorSpace_Base.h" | 14 #include "SkColorSpace_XYZTRC.h" |
15 #include "SkColorSpaceXform.h" | 15 #include "SkColorSpaceXform.h" |
16 #include "SkCommonFlags.h" | 16 #include "SkCommonFlags.h" |
17 #include "SkData.h" | 17 #include "SkData.h" |
18 #include "SkDeferredCanvas.h" | 18 #include "SkDeferredCanvas.h" |
19 #include "SkDocument.h" | 19 #include "SkDocument.h" |
20 #include "SkImageGenerator.h" | 20 #include "SkImageGenerator.h" |
21 #include "SkImageGeneratorCG.h" | 21 #include "SkImageGeneratorCG.h" |
22 #include "SkImageGeneratorWIC.h" | 22 #include "SkImageGeneratorWIC.h" |
23 #include "SkLiteDL.h" | 23 #include "SkLiteDL.h" |
24 #include "SkLiteRecorder.h" | 24 #include "SkLiteRecorder.h" |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 913 dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
914 } else if (kDst_HPZR30w_Mode == fMode) { | 914 } else if (kDst_HPZR30w_Mode == fMode) { |
915 dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); | 915 dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); |
916 } | 916 } |
917 | 917 |
918 SkImageInfo decodeInfo = codec->getInfo().makeColorType(fColorType).makeColo
rSpace(dstSpace); | 918 SkImageInfo decodeInfo = codec->getInfo().makeColorType(fColorType).makeColo
rSpace(dstSpace); |
919 if (kUnpremul_SkAlphaType == decodeInfo.alphaType()) { | 919 if (kUnpremul_SkAlphaType == decodeInfo.alphaType()) { |
920 decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); | 920 decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); |
921 } | 921 } |
922 if (kRGBA_F16_SkColorType == fColorType) { | 922 if (kRGBA_F16_SkColorType == fColorType) { |
923 decodeInfo = decodeInfo.makeColorSpace(as_CSB(decodeInfo.colorSpace())->
makeLinearGamma()); | 923 SkASSERT(as_CSB(decodeInfo.colorSpace())->toXYZD50()); |
| 924 SkColorSpace_XYZTRC* csXYZ = static_cast<SkColorSpace_XYZTRC*>(decodeInf
o.colorSpace()); |
| 925 decodeInfo = decodeInfo.makeColorSpace(csXYZ->makeLinearGamma()); |
924 } | 926 } |
925 | 927 |
926 SkImageInfo bitmapInfo = decodeInfo; | 928 SkImageInfo bitmapInfo = decodeInfo; |
927 if (kRGBA_8888_SkColorType == decodeInfo.colorType() || | 929 if (kRGBA_8888_SkColorType == decodeInfo.colorType() || |
928 kBGRA_8888_SkColorType == decodeInfo.colorType()) | 930 kBGRA_8888_SkColorType == decodeInfo.colorType()) |
929 { | 931 { |
930 bitmapInfo = bitmapInfo.makeColorType(kN32_SkColorType); | 932 bitmapInfo = bitmapInfo.makeColorType(kN32_SkColorType); |
931 } | 933 } |
932 | 934 |
933 SkBitmap bitmap; | 935 SkBitmap bitmap; |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 Error err = src.draw(&rec); | 1706 Error err = src.draw(&rec); |
1705 if (!err.isEmpty()) { | 1707 if (!err.isEmpty()) { |
1706 return err; | 1708 return err; |
1707 } | 1709 } |
1708 dl->draw(canvas); | 1710 dl->draw(canvas); |
1709 return check_against_reference(bitmap, src, fSink); | 1711 return check_against_reference(bitmap, src, fSink); |
1710 }); | 1712 }); |
1711 } | 1713 } |
1712 | 1714 |
1713 } // namespace DM | 1715 } // namespace DM |
OLD | NEW |