| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 "SkBitmapProcState_opts_SSSE3.h" | 8 #include "SkBitmapProcState_opts_SSSE3.h" |
| 9 #include "SkColorPriv.h" |
| 9 #include "SkPaint.h" | 10 #include "SkPaint.h" |
| 10 #include "SkUtils.h" | 11 #include "SkUtils.h" |
| 11 | 12 |
| 12 /* With the exception of the compilers that don't support it, we always build th
e | 13 /* With the exception of the compilers that don't support it, we always build th
e |
| 13 * SSSE3 functions and enable the caller to determine SSSE3 support. However fo
r | 14 * SSSE3 functions and enable the caller to determine SSSE3 support. However fo
r |
| 14 * compilers that do not support SSSE3 we provide a stub implementation. | 15 * compilers that do not support SSSE3 we provide a stub implementation. |
| 15 */ | 16 */ |
| 16 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | 17 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 |
| 17 | 18 |
| 18 #include <tmmintrin.h> // SSSE3 | 19 #include <tmmintrin.h> // SSSE3 |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 S32_generic_D32_filter_DX_SSSE3<false>(s, xy, count, colors); | 714 S32_generic_D32_filter_DX_SSSE3<false>(s, xy, count, colors); |
| 714 } | 715 } |
| 715 | 716 |
| 716 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | 717 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, |
| 717 const uint32_t* xy, | 718 const uint32_t* xy, |
| 718 int count, uint32_t* colors) { | 719 int count, uint32_t* colors) { |
| 719 S32_generic_D32_filter_DX_SSSE3<true>(s, xy, count, colors); | 720 S32_generic_D32_filter_DX_SSSE3<true>(s, xy, count, colors); |
| 720 } | 721 } |
| 721 | 722 |
| 722 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 723 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 723 const uint32_t* xy, | 724 const uint32_t* xy, |
| 724 int count, uint32_t* colors) { | 725 int count, uint32_t* colors) { |
| 725 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); | 726 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); |
| 726 } | 727 } |
| 727 | 728 |
| 728 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 729 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 729 const uint32_t* xy, | 730 const uint32_t* xy, |
| 730 int count, uint32_t* colors) { | 731 int count, uint32_t* colors) { |
| 731 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); | 732 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); |
| 732 } | 733 } |
| 733 | 734 |
| 735 void S32_D16_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 736 const uint32_t* xy, |
| 737 int count, uint16_t* colors) { |
| 738 SkASSERT(64 >= count); |
| 739 SkAutoSTMalloc<64, uint32_t> colors32(count); |
| 740 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors32); |
| 741 for(int i = 0; i < count; i++) { |
| 742 *colors++ = SkPixel32ToPixel16(colors32[i]); |
| 743 } |
| 744 } |
| 745 |
| 734 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | 746 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 |
| 735 | 747 |
| 736 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | 748 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, |
| 737 const uint32_t* xy, | 749 const uint32_t* xy, |
| 738 int count, uint32_t* colors) { | 750 int count, uint32_t* colors) { |
| 739 sk_throw(); | 751 sk_throw(); |
| 740 } | 752 } |
| 741 | 753 |
| 742 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | 754 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, |
| 743 const uint32_t* xy, | 755 const uint32_t* xy, |
| 744 int count, uint32_t* colors) { | 756 int count, uint32_t* colors) { |
| 745 sk_throw(); | 757 sk_throw(); |
| 746 } | 758 } |
| 747 | 759 |
| 748 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 760 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 749 const uint32_t* xy, | 761 const uint32_t* xy, |
| 750 int count, uint32_t* colors) { | 762 int count, uint32_t* colors) { |
| 751 sk_throw(); | 763 sk_throw(); |
| 752 } | 764 } |
| 753 | 765 |
| 754 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 766 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 755 const uint32_t* xy, | 767 const uint32_t* xy, |
| 756 int count, uint32_t* colors) { | 768 int count, uint32_t* colors) { |
| 757 sk_throw(); | 769 sk_throw(); |
| 758 } | 770 } |
| 759 | 771 |
| 772 void S32_D16_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 773 const uint32_t* xy, |
| 774 int count, uint16_t* colors) { |
| 775 sk_throw(); |
| 776 } |
| 777 |
| 760 #endif | 778 #endif |
| OLD | NEW |