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 "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkOpts.h" | 10 #include "SkOpts.h" |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 break; | 797 break; |
798 default: | 798 default: |
799 return nullptr; | 799 return nullptr; |
800 } | 800 } |
801 break; | 801 break; |
802 default: | 802 default: |
803 return nullptr; | 803 return nullptr; |
804 } | 804 } |
805 break; | 805 break; |
806 case SkEncodedInfo::kRGB_Color: | 806 case SkEncodedInfo::kRGB_Color: |
| 807 case SkEncodedInfo::k565_Color: |
| 808 // Treat 565 exactly like RGB (since it's still encoded as 8 bit
s per component). |
| 809 // We just mark as 565 when have a hint that there are only 5/6
"significant" bits. |
807 switch (dstInfo.colorType()) { | 810 switch (dstInfo.colorType()) { |
808 case kRGBA_8888_SkColorType: | 811 case kRGBA_8888_SkColorType: |
809 proc = &swizzle_rgb_to_rgba; | 812 proc = &swizzle_rgb_to_rgba; |
810 fastProc = &fast_swizzle_rgb_to_rgba; | 813 fastProc = &fast_swizzle_rgb_to_rgba; |
811 break; | 814 break; |
812 case kBGRA_8888_SkColorType: | 815 case kBGRA_8888_SkColorType: |
813 proc = &swizzle_rgb_to_bgra; | 816 proc = &swizzle_rgb_to_bgra; |
814 fastProc = &fast_swizzle_rgb_to_bgra; | 817 fastProc = &fast_swizzle_rgb_to_bgra; |
815 break; | 818 break; |
816 case kRGB_565_SkColorType: | 819 case kRGB_565_SkColorType: |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 } | 1039 } |
1037 | 1040 |
1038 return fAllocatedWidth; | 1041 return fAllocatedWidth; |
1039 } | 1042 } |
1040 | 1043 |
1041 void SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRICT src) { | 1044 void SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRICT src) { |
1042 SkASSERT(nullptr != dst && nullptr != src); | 1045 SkASSERT(nullptr != dst && nullptr != src); |
1043 fActualProc(SkTAddOffset<void>(dst, fDstOffsetBytes), src, fSwizzleWidth, fS
rcBPP, | 1046 fActualProc(SkTAddOffset<void>(dst, fDstOffsetBytes), src, fSwizzleWidth, fS
rcBPP, |
1044 fSampleX * fSrcBPP, fSrcOffsetUnits, fColorTable); | 1047 fSampleX * fSrcBPP, fSrcOffsetUnits, fColorTable); |
1045 } | 1048 } |
OLD | NEW |