| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Android Open Source Project | 2 * Copyright 2014 The Android Open Source Project |
| 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 "SkBlitRow.h" | 8 #include "SkBlitRow.h" |
| 9 #include "SkBlitMask.h" | 9 #include "SkBlitMask.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 : [alpha]"r"(alpha) | 746 : [alpha]"r"(alpha) |
| 747 : "memory", "hi", "lo" | 747 : "memory", "hi", "lo" |
| 748 ); | 748 ); |
| 749 | 749 |
| 750 if (count == 1) { | 750 if (count == 1) { |
| 751 SkPMColor sc = *src++; | 751 SkPMColor sc = *src++; |
| 752 SkPMColorAssert(sc); | 752 SkPMColorAssert(sc); |
| 753 if (sc) { | 753 if (sc) { |
| 754 uint16_t dc = *dst; | 754 uint16_t dc = *dst; |
| 755 unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alph
a); | 755 unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alph
a); |
| 756 unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + | 756 unsigned dr = (SkPacked32ToR16(sc) * alpha) + (SkGetPackedR16(dc) *
dst_scale); |
| 757 SkMulS16(SkGetPackedR16(dc), dst_scale); | 757 unsigned dg = (SkPacked32ToG16(sc) * alpha) + (SkGetPackedG16(dc) *
dst_scale); |
| 758 unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + | 758 unsigned db = (SkPacked32ToB16(sc) * alpha) + (SkGetPackedB16(dc) *
dst_scale); |
| 759 SkMulS16(SkGetPackedG16(dc), dst_scale); | |
| 760 unsigned db = SkMulS16(SkPacked32ToB16(sc), alpha) + | |
| 761 SkMulS16(SkGetPackedB16(dc), dst_scale); | |
| 762 *dst = SkPackRGB16(SkDiv255Round(dr), SkDiv255Round(dg), SkDiv255Rou
nd(db)); | 759 *dst = SkPackRGB16(SkDiv255Round(dr), SkDiv255Round(dg), SkDiv255Rou
nd(db)); |
| 763 } | 760 } |
| 764 dst += 1; | 761 dst += 1; |
| 765 } | 762 } |
| 766 } | 763 } |
| 767 | 764 |
| 768 static void S32_Blend_BlitRow32_mips_dsp(SkPMColor* SK_RESTRICT dst, | 765 static void S32_Blend_BlitRow32_mips_dsp(SkPMColor* SK_RESTRICT dst, |
| 769 const SkPMColor* SK_RESTRICT src, | 766 const SkPMColor* SK_RESTRICT src, |
| 770 int count, U8CPU alpha) { | 767 int count, U8CPU alpha) { |
| 771 register int32_t t0, t1, t2, t3, t4, t5, t6, t7; | 768 register int32_t t0, t1, t2, t3, t4, t5, t6, t7; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 return platform_565_procs_mips_dsp[flags]; | 943 return platform_565_procs_mips_dsp[flags]; |
| 947 } | 944 } |
| 948 | 945 |
| 949 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) { | 946 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) { |
| 950 return NULL; | 947 return NULL; |
| 951 } | 948 } |
| 952 | 949 |
| 953 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { | 950 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { |
| 954 return platform_32_procs_mips_dsp[flags]; | 951 return platform_32_procs_mips_dsp[flags]; |
| 955 } | 952 } |
| OLD | NEW |