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 "SkColorPriv.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
11 #include "SkUtils.h" | 11 #include "SkUtils.h" |
12 | 12 |
13 /* With the exception of the compilers that don't support it, we always build th
e | |
14 * SSSE3 functions and enable the caller to determine SSSE3 support. However fo
r | |
15 * compilers that do not support SSSE3 we provide a stub implementation. | |
16 */ | |
17 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | |
18 | |
19 #include <tmmintrin.h> // SSSE3 | |
20 | |
21 // adding anonymous namespace seemed to force gcc to inline directly the | 13 // adding anonymous namespace seemed to force gcc to inline directly the |
22 // instantiation, instead of creating the functions | 14 // instantiation, instead of creating the functions |
23 // S32_generic_D32_filter_DX_SSSE3<true> and | 15 // S32_generic_D32_filter_DX_SSSE3<true> and |
24 // 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 |
25 // external functions. | 17 // external functions. |
26 namespace { | 18 namespace { |
27 // 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 |
28 // 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 |
29 // 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 |
30 // two functions that only differ by a few lines. | 22 // two functions that only differ by a few lines. |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 const uint32_t* xy, | 716 const uint32_t* xy, |
725 int count, uint32_t* colors) { | 717 int count, uint32_t* colors) { |
726 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); | 718 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); |
727 } | 719 } |
728 | 720 |
729 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 721 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
730 const uint32_t* xy, | 722 const uint32_t* xy, |
731 int count, uint32_t* colors) { | 723 int count, uint32_t* colors) { |
732 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); | 724 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); |
733 } | 725 } |
734 | |
735 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | |
736 | |
737 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | |
738 const uint32_t* xy, | |
739 int count, uint32_t* colors) { | |
740 sk_throw(); | |
741 } | |
742 | |
743 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | |
744 const uint32_t* xy, | |
745 int count, uint32_t* colors) { | |
746 sk_throw(); | |
747 } | |
748 | |
749 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | |
750 const uint32_t* xy, | |
751 int count, uint32_t* colors) { | |
752 sk_throw(); | |
753 } | |
754 | |
755 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | |
756 const uint32_t* xy, | |
757 int count, uint32_t* colors) { | |
758 sk_throw(); | |
759 } | |
760 | |
761 #endif | |
OLD | NEW |