| 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 <tmmintrin.h> // SSSE3 |
| 8 #include "SkBitmapProcState_opts_SSSE3.h" | 9 #include "SkBitmapProcState_opts_SSSE3.h" |
| 9 #include "SkPaint.h" | 10 #include "SkPaint.h" |
| 10 #include "SkUtils.h" | 11 #include "SkUtils.h" |
| 11 | 12 |
| 12 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | |
| 13 #include <tmmintrin.h> // SSSE3 | |
| 14 | |
| 15 // adding anonymous namespace seemed to force gcc to inline directly the | 13 // adding anonymous namespace seemed to force gcc to inline directly the |
| 16 // instantiation, instead of creating the functions | 14 // instantiation, instead of creating the functions |
| 17 // S32_generic_D32_filter_DX_SSSE3<true> and | 15 // S32_generic_D32_filter_DX_SSSE3<true> and |
| 18 // S32_generic_D32_filter_DX_SSSE3<false> which were then called by the | 16 // S32_generic_D32_filter_DX_SSSE3<false> which were then called by the |
| 19 // external functions. | 17 // external functions. |
| 20 namespace { | 18 namespace { |
| 21 // In this file, variations for alpha and non alpha versions are implemented | 19 // In this file, variations for alpha and non alpha versions are implemented |
| 22 // with a template, as it makes the code more compact and a bit easier to | 20 // with a template, as it makes the code more compact and a bit easier to |
| 23 // maintain, while making the compiler generate the same exact code as with | 21 // maintain, while making the compiler generate the same exact code as with |
| 24 // two functions that only differ by a few lines. | 22 // two functions that only differ by a few lines. |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 const uint32_t* xy, | 715 const uint32_t* xy, |
| 718 int count, uint32_t* colors) { | 716 int count, uint32_t* colors) { |
| 719 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); | 717 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); |
| 720 } | 718 } |
| 721 | 719 |
| 722 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 720 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
| 723 const uint32_t* xy, | 721 const uint32_t* xy, |
| 724 int count, uint32_t* colors) { | 722 int count, uint32_t* colors) { |
| 725 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); | 723 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); |
| 726 } | 724 } |
| 727 | |
| 728 #else //SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | |
| 729 | |
| 730 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | |
| 731 const uint32_t* xy, | |
| 732 int count, uint32_t* colors) { | |
| 733 sk_throw(); | |
| 734 } | |
| 735 | |
| 736 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | |
| 737 const uint32_t* xy, | |
| 738 int count, uint32_t* colors) { | |
| 739 sk_throw(); | |
| 740 } | |
| 741 | |
| 742 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | |
| 743 const uint32_t* xy, | |
| 744 int count, uint32_t* colors) { | |
| 745 sk_throw(); | |
| 746 } | |
| 747 | |
| 748 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | |
| 749 const uint32_t* xy, | |
| 750 int count, uint32_t* colors) { | |
| 751 sk_throw(); | |
| 752 } | |
| 753 | |
| 754 #endif | |
| OLD | NEW |