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 #include "SkOpts.h" | 8 #include "SkOpts.h" |
| 9 |
| 10 #define SK_OPTS_NS sse2 |
| 11 #include "SkBlurImageFilter_opts.h" |
9 #include "SkXfermode_opts.h" | 12 #include "SkXfermode_opts.h" |
10 | 13 |
11 namespace sse2 { // This helps identify methods from this file when debugging /
profiling. | 14 namespace sse2 { // This helps identify methods from this file when debugging /
profiling. |
12 | 15 |
13 static void memset16(uint16_t* dst, uint16_t val, int n) { | 16 static void memset16(uint16_t* dst, uint16_t val, int n) { |
14 auto dst8 = (__m128i*)dst; | 17 auto dst8 = (__m128i*)dst; |
15 auto val8 = _mm_set1_epi16(val); | 18 auto val8 = _mm_set1_epi16(val); |
16 for ( ; n >= 8; n -= 8) { | 19 for ( ; n >= 8; n -= 8) { |
17 _mm_storeu_si128(dst8++, val8); | 20 _mm_storeu_si128(dst8++, val8); |
18 } | 21 } |
(...skipping 27 matching lines...) Expand all Loading... |
46 } | 49 } |
47 } | 50 } |
48 | 51 |
49 } // namespace sse2 | 52 } // namespace sse2 |
50 | 53 |
51 namespace SkOpts { | 54 namespace SkOpts { |
52 void Init_sse2() { | 55 void Init_sse2() { |
53 memset16 = sse2::memset16; | 56 memset16 = sse2::memset16; |
54 memset32 = sse2::memset32; | 57 memset32 = sse2::memset32; |
55 create_xfermode = SkCreate4pxXfermode; | 58 create_xfermode = SkCreate4pxXfermode; |
| 59 |
| 60 static const auto x = sse2::kX, y = sse2::kY; |
| 61 box_blur_xx = sse2::box_blur<x,x>; |
| 62 box_blur_xy = sse2::box_blur<x,y>; |
| 63 box_blur_yx = sse2::box_blur<y,x>; |
56 } | 64 } |
57 } | 65 } |
OLD | NEW |