OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "skia/ext/convolver.h" | 7 #include "skia/ext/convolver.h" |
8 #include "skia/ext/convolver_SSE2.h" | 8 #include "skia/ext/convolver_SSE2.h" |
9 #include "third_party/skia/include/core/SkTypes.h" | 9 #include "third_party/skia/include/core/SkTypes.h" |
10 | 10 |
11 #include <emmintrin.h> // ARCH_CPU_X86_FAMILY was defined in build/config.h | 11 #include <emmintrin.h> // ARCH_CPU_X86_FAMILY was defined in build/config.h |
12 | 12 |
13 namespace skia { | 13 namespace skia { |
14 | 14 |
15 // Convolves horizontally along a single row. The row data is given in | 15 // Convolves horizontally along a single row. The row data is given in |
16 // |src_data| and continues for the num_values() of the filter. | 16 // |src_data| and continues for the num_values() of the filter. |
17 void ConvolveHorizontally_SSE2(const unsigned char* src_data, | 17 void ConvolveHorizontally_SSE2(const unsigned char* src_data, |
18 const ConvolutionFilter1D& filter, | 18 const ConvolutionFilter1D& filter, |
19 unsigned char* out_row) { | 19 unsigned char* out_row, |
| 20 bool /*has_alpha*/) { |
20 int num_values = filter.num_values(); | 21 int num_values = filter.num_values(); |
21 | 22 |
22 int filter_offset, filter_length; | 23 int filter_offset, filter_length; |
23 __m128i zero = _mm_setzero_si128(); | 24 __m128i zero = _mm_setzero_si128(); |
24 __m128i mask[4]; | 25 __m128i mask[4]; |
25 // |mask| will be used to decimate all extra filter coefficients that are | 26 // |mask| will be used to decimate all extra filter coefficients that are |
26 // loaded by SIMD when |filter_length| is not divisible by 4. | 27 // loaded by SIMD when |filter_length| is not divisible by 4. |
27 // mask[0] is not used in following algorithm. | 28 // mask[0] is not used in following algorithm. |
28 mask[1] = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, -1); | 29 mask[1] = _mm_set_epi16(0, 0, 0, 0, 0, 0, 0, -1); |
29 mask[2] = _mm_set_epi16(0, 0, 0, 0, 0, 0, -1, -1); | 30 mask[2] = _mm_set_epi16(0, 0, 0, 0, 0, 0, -1, -1); |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } else { | 448 } else { |
448 ConvolveVertically_SSE2<false>(filter_values, | 449 ConvolveVertically_SSE2<false>(filter_values, |
449 filter_length, | 450 filter_length, |
450 source_data_rows, | 451 source_data_rows, |
451 pixel_width, | 452 pixel_width, |
452 out_row); | 453 out_row); |
453 } | 454 } |
454 } | 455 } |
455 | 456 |
456 } // namespace skia | 457 } // namespace skia |
OLD | NEW |