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 } | |
902 | 899 |
903 SkImageInfo bitmapInfo = decodeInfo; | 900 SkImageInfo bitmapInfo = decodeInfo; |
904 if (kRGBA_8888_SkColorType == decodeInfo.colorType() || | 901 if (kRGBA_8888_SkColorType == decodeInfo.colorType() || |
905 kBGRA_8888_SkColorType == decodeInfo.colorType()) | 902 kBGRA_8888_SkColorType == decodeInfo.colorType()) |
906 { | 903 { |
907 bitmapInfo = bitmapInfo.makeColorType(kN32_SkColorType); | 904 bitmapInfo = bitmapInfo.makeColorType(kN32_SkColorType); |
908 } | 905 } |
909 | 906 |
910 SkBitmap bitmap; | 907 SkBitmap bitmap; |
911 if (!bitmap.tryAllocPixels(bitmapInfo)) { | 908 if (!bitmap.tryAllocPixels(bitmapInfo)) { |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 Error err = src.draw(&rec); | 1633 Error err = src.draw(&rec); |
1637 if (!err.isEmpty()) { | 1634 if (!err.isEmpty()) { |
1638 return err; | 1635 return err; |
1639 } | 1636 } |
1640 dl->draw(canvas); | 1637 dl->draw(canvas); |
1641 return check_against_reference(bitmap, src, fSink); | 1638 return check_against_reference(bitmap, src, fSink); |
1642 }); | 1639 }); |
1643 } | 1640 } |
1644 | 1641 |
1645 } // namespace DM | 1642 } // namespace DM |
OLD | NEW |