| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBlurImage_opts_SSE4.h" | 9 #include "SkBlurImage_opts_SSE4.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| 11 #include "SkRect.h" | 11 #include "SkRect.h" |
| 12 | 12 |
| 13 /* With the exception of the Android framework we always build the SSE4 function
s | 13 /* With the exception of the compilers that don't support it, we always build th
e |
| 14 * and enable the caller to determine SSE4 support. However, for the Android fr
amework, | 14 * SSE4 functions and enable the caller to determine SSE4 support. However for |
| 15 * if the device does not support SSE4x then the compiler will not supply the re
quired | 15 * compilers that do not support SSE4x we provide a stub implementation. |
| 16 * -msse4* option needed to build this file, so instead we provide a stub implem
entation. | |
| 17 */ | 16 */ |
| 18 #if !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) || SK_CPU_SSE_LEVEL >= SK_CPU_SSE_L
EVEL_SSE41 | 17 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 |
| 19 | 18 |
| 20 #include <smmintrin.h> | 19 #include <smmintrin.h> |
| 21 | 20 |
| 22 namespace { | 21 namespace { |
| 23 enum BlurDirection { | 22 enum BlurDirection { |
| 24 kX, kY | 23 kX, kY |
| 25 }; | 24 }; |
| 26 | 25 |
| 27 /* Helper function to spread the components of a 32-bit integer into the | 26 /* Helper function to spread the components of a 32-bit integer into the |
| 28 * lower 8 bits of each 32-bit element of an SSE register. | 27 * lower 8 bits of each 32-bit element of an SSE register. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 SkBoxBlurProc* boxBlurY, | 102 SkBoxBlurProc* boxBlurY, |
| 104 SkBoxBlurProc* boxBlurXY, | 103 SkBoxBlurProc* boxBlurXY, |
| 105 SkBoxBlurProc* boxBlurYX) { | 104 SkBoxBlurProc* boxBlurYX) { |
| 106 *boxBlurX = SkBoxBlur_SSE4<kX, kX>; | 105 *boxBlurX = SkBoxBlur_SSE4<kX, kX>; |
| 107 *boxBlurY = SkBoxBlur_SSE4<kY, kY>; | 106 *boxBlurY = SkBoxBlur_SSE4<kY, kY>; |
| 108 *boxBlurXY = SkBoxBlur_SSE4<kX, kY>; | 107 *boxBlurXY = SkBoxBlur_SSE4<kX, kY>; |
| 109 *boxBlurYX = SkBoxBlur_SSE4<kY, kX>; | 108 *boxBlurYX = SkBoxBlur_SSE4<kY, kX>; |
| 110 return true; | 109 return true; |
| 111 } | 110 } |
| 112 | 111 |
| 113 #else // !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) || SK_CPU_SSE_LEVEL >= SK_CPU_
SSE_LEVEL_SSE41 | 112 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 |
| 114 | 113 |
| 115 bool SkBoxBlurGetPlatformProcs_SSE4(SkBoxBlurProc* boxBlurX, | 114 bool SkBoxBlurGetPlatformProcs_SSE4(SkBoxBlurProc* boxBlurX, |
| 116 SkBoxBlurProc* boxBlurY, | 115 SkBoxBlurProc* boxBlurY, |
| 117 SkBoxBlurProc* boxBlurXY, | 116 SkBoxBlurProc* boxBlurXY, |
| 118 SkBoxBlurProc* boxBlurYX) { | 117 SkBoxBlurProc* boxBlurYX) { |
| 119 sk_throw(); | 118 sk_throw(); |
| 120 return false; | 119 return false; |
| 121 } | 120 } |
| 122 | 121 |
| 123 | 122 |
| 124 #endif | 123 #endif |
| OLD | NEW |