| 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 "SkPaint.h" | 9 #include "SkPaint.h" |
| 10 #include "SkUtils.h" | 10 #include "SkUtils.h" |
| 11 | 11 |
| 12 /* With the exception of the compilers that don't support it, we always build th
e | 12 /* With the exception of the Android framework we always build the SSSE3 functio
ns |
| 13 * SSSE3 functions and enable the caller to determine SSSE3 support. However fo
r | 13 * and enable the caller to determine SSSE3 support. However for the Android fr
amework |
| 14 * compilers that do not support SSSE3 we provide a stub implementation. | 14 * if the device does not support SSSE3 then the compiler will not supply the re
quired |
| 15 * -mssse3 option needed to build this file, so instead we provide a stub implem
entation. |
| 15 */ | 16 */ |
| 16 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | 17 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) || SK_CPU_SSE_LEVEL >= SK_CPU_SSE_L
EVEL_SSSE3 |
| 17 | 18 |
| 18 #include <tmmintrin.h> // SSSE3 | 19 #include <tmmintrin.h> // SSSE3 |
| 19 | 20 |
| 20 // adding anonymous namespace seemed to force gcc to inline directly the | 21 // adding anonymous namespace seemed to force gcc to inline directly the |
| 21 // instantiation, instead of creating the functions | 22 // instantiation, instead of creating the functions |
| 22 // S32_generic_D32_filter_DX_SSSE3<true> and | 23 // S32_generic_D32_filter_DX_SSSE3<true> and |
| 23 // S32_generic_D32_filter_DX_SSSE3<false> which were then called by the | 24 // S32_generic_D32_filter_DX_SSSE3<false> which were then called by the |
| 24 // external functions. | 25 // external functions. |
| 25 namespace { | 26 namespace { |
| 26 // In this file, variations for alpha and non alpha versions are implemented | 27 // In this file, variations for alpha and non alpha versions are implemented |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 734 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | 735 #else // !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) || SK_CPU_SSE_LEVEL >= SK_CPU_
SSE_LEVEL_SSSE3 |
| 735 | 736 |
| 736 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | 737 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, |
| 737 const uint32_t* xy, | 738 const uint32_t* xy, |
| 738 int count, uint32_t* colors) { | 739 int count, uint32_t* colors) { |
| 739 sk_throw(); | 740 sk_throw(); |
| 740 } | 741 } |
| 741 | 742 |
| 742 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | 743 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, |
| 743 const uint32_t* xy, | 744 const uint32_t* xy, |
| 744 int count, uint32_t* colors) { | 745 int count, uint32_t* colors) { |
| 745 sk_throw(); | 746 sk_throw(); |
| 746 } | 747 } |
| 747 | 748 |
| 748 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 749 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 749 const uint32_t* xy, | 750 const uint32_t* xy, |
| 750 int count, uint32_t* colors) { | 751 int count, uint32_t* colors) { |
| 751 sk_throw(); | 752 sk_throw(); |
| 752 } | 753 } |
| 753 | 754 |
| 754 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 755 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 755 const uint32_t* xy, | 756 const uint32_t* xy, |
| 756 int count, uint32_t* colors) { | 757 int count, uint32_t* colors) { |
| 757 sk_throw(); | 758 sk_throw(); |
| 758 } | 759 } |
| 759 | 760 |
| 760 #endif | 761 #endif |
| OLD | NEW |