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