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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 if (kDst_sRGB_Mode == fMode) { | 889 if (kDst_sRGB_Mode == fMode) { |
890 dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 890 dstSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
891 } else if (kDst_HPZR30w_Mode == fMode) { | 891 } else if (kDst_HPZR30w_Mode == fMode) { |
892 dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); | 892 dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size()); |
893 } | 893 } |
894 | 894 |
895 SkImageInfo decodeInfo = codec->getInfo().makeColorType(fColorType).makeColo
rSpace(dstSpace); | 895 SkImageInfo decodeInfo = codec->getInfo().makeColorType(fColorType).makeColo
rSpace(dstSpace); |
896 if (kUnpremul_SkAlphaType == decodeInfo.alphaType()) { | 896 if (kUnpremul_SkAlphaType == decodeInfo.alphaType()) { |
897 decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); | 897 decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); |
898 } | 898 } |
| 899 if (kRGBA_F16_SkColorType == fColorType) { |
| 900 decodeInfo = decodeInfo.makeColorSpace(decodeInfo.colorSpace()->makeLine
arGamma()); |
| 901 } |
899 | 902 |
900 SkImageInfo bitmapInfo = decodeInfo; | 903 SkImageInfo bitmapInfo = decodeInfo; |
901 if (kRGBA_8888_SkColorType == decodeInfo.colorType() || | 904 if (kRGBA_8888_SkColorType == decodeInfo.colorType() || |
902 kBGRA_8888_SkColorType == decodeInfo.colorType()) | 905 kBGRA_8888_SkColorType == decodeInfo.colorType()) |
903 { | 906 { |
904 bitmapInfo = bitmapInfo.makeColorType(kN32_SkColorType); | 907 bitmapInfo = bitmapInfo.makeColorType(kN32_SkColorType); |
905 } | 908 } |
906 | 909 |
907 SkBitmap bitmap; | 910 SkBitmap bitmap; |
908 if (!bitmap.tryAllocPixels(bitmapInfo)) { | 911 if (!bitmap.tryAllocPixels(bitmapInfo)) { |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 Error err = src.draw(&rec); | 1636 Error err = src.draw(&rec); |
1634 if (!err.isEmpty()) { | 1637 if (!err.isEmpty()) { |
1635 return err; | 1638 return err; |
1636 } | 1639 } |
1637 dl->draw(canvas); | 1640 dl->draw(canvas); |
1638 return check_against_reference(bitmap, src, fSink); | 1641 return check_against_reference(bitmap, src, fSink); |
1639 }); | 1642 }); |
1640 } | 1643 } |
1641 | 1644 |
1642 } // namespace DM | 1645 } // namespace DM |
OLD | NEW |