Chromium Code Reviews| Index: skia/ext/convolver.cc |
| diff --git a/skia/ext/convolver.cc b/skia/ext/convolver.cc |
| index 2057b2219aa39ae6ea1fd28d2fc4671729dc2463..e3396cd1c5403a3beadd26bdb08cf5cb167c7cf3 100644 |
| --- a/skia/ext/convolver.cc |
| +++ b/skia/ext/convolver.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/logging.h" |
| #include "skia/ext/convolver.h" |
| #include "skia/ext/convolver_SSE2.h" |
| +#include "skia/ext/convolver_mips_dspr2.h" |
| #include "third_party/skia/include/core/SkSize.h" |
| #include "third_party/skia/include/core/SkTypes.h" |
| @@ -344,10 +345,18 @@ typedef void (*Convolve4RowsHorizontally_pointer)( |
| const unsigned char* src_data[4], |
| const ConvolutionFilter1D& filter, |
| unsigned char* out_row[4]); |
| +#if SIMD_MIPS_DSPR2 |
| +typedef void (*ConvolveHorizontally_pointer)( |
| + const unsigned char* src_data, |
| + const ConvolutionFilter1D& filter, |
| + unsigned char* out_row, |
| + bool has_alpha); |
|
hubbe
2013/05/10 19:39:09
Just add "has_alpha" to all implementations instea
Stephen White
2013/05/10 20:31:26
+1 to that.
|
| +#else |
| typedef void (*ConvolveHorizontally_pointer)( |
| const unsigned char* src_data, |
| const ConvolutionFilter1D& filter, |
| unsigned char* out_row); |
| +#endif |
| struct ConvolveProcs { |
| // This is how many extra pixels may be read by the |
| @@ -367,6 +376,10 @@ void SetupSIMD(ConvolveProcs *procs) { |
| procs->convolve_4rows_horizontally = &Convolve4RowsHorizontally_SSE2; |
| procs->convolve_horizontally = &ConvolveHorizontally_SSE2; |
| } |
| +#elif defined SIMD_MIPS_DSPR2 |
|
Stephen White
2013/05/10 20:31:26
You use "#if" above, but "#if defined" here. Plea
Stephen White
2013/05/13 14:08:43
Sorry, my mistake. This should be #elif defined(S
Teodora Novkovic
2013/05/13 16:23:06
Done.
Teodora Novkovic
2013/05/13 16:23:06
Done.
|
| + procs->extra_horizontal_reads = 3; |
| + procs->convolve_vertically = &ConvolveVertically_mips_dspr2; |
| + procs->convolve_horizontally = &ConvolveHorizontally_mips_dspr2; |
| #endif |
| } |
| @@ -462,9 +475,15 @@ void BGRAConvolve2D(const unsigned char* source_data, |
| if (simd.convolve_horizontally && |
| next_x_row < last_filter_offset + last_filter_length - |
| avoid_simd_rows) { |
| +#if SIMD_MIPS_DSPR2 |
| + simd.convolve_horizontally( |
| + &source_data[next_x_row * source_byte_row_stride], |
| + filter_x, row_buffer.AdvanceRow(), source_has_alpha); |
| +#else |
| simd.convolve_horizontally( |
| &source_data[next_x_row * source_byte_row_stride], |
| filter_x, row_buffer.AdvanceRow()); |
| +#endif |
| } else { |
| if (source_has_alpha) { |
| ConvolveHorizontally<true>( |