OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 #ifndef SkBlurImageFilter_opts_DEFINED | 8 #ifndef SkBlurImageFilter_opts_DEFINED |
9 #define SkBlurImageFilter_opts_DEFINED | 9 #define SkBlurImageFilter_opts_DEFINED |
10 | 10 |
11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
13 | 13 |
| 14 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
| 15 #include <immintrin.h> |
| 16 #endif |
| 17 |
14 namespace SK_OPTS_NS { | 18 namespace SK_OPTS_NS { |
15 | 19 |
16 enum class BlurDirection { kX, kY }; | 20 enum class BlurDirection { kX, kY }; |
17 | 21 |
18 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 22 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
19 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 | 23 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 |
20 // ARGB -> 000A 000R 000G 000B | 24 // ARGB -> 000A 000R 000G 000B |
21 static inline __m128i expand(SkPMColor p) { | 25 static inline __m128i expand(SkPMColor p) { |
22 return _mm_cvtepu8_epi32(_mm_cvtsi32_si128(p)); | 26 return _mm_cvtepu8_epi32(_mm_cvtsi32_si128(p)); |
23 }; | 27 }; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 313 } |
310 } | 314 } |
311 | 315 |
312 static auto box_blur_xx = &box_blur<BlurDirection::kX, BlurDirection::kX>, | 316 static auto box_blur_xx = &box_blur<BlurDirection::kX, BlurDirection::kX>, |
313 box_blur_xy = &box_blur<BlurDirection::kX, BlurDirection::kY>, | 317 box_blur_xy = &box_blur<BlurDirection::kX, BlurDirection::kY>, |
314 box_blur_yx = &box_blur<BlurDirection::kY, BlurDirection::kX>; | 318 box_blur_yx = &box_blur<BlurDirection::kY, BlurDirection::kX>; |
315 | 319 |
316 } // namespace SK_OPTS_NS | 320 } // namespace SK_OPTS_NS |
317 | 321 |
318 #endif | 322 #endif |
OLD | NEW |