| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBitmapProcState.h" | 8 #include "SkBitmapProcState.h" |
| 9 #include "SkBitmapProcState_filter.h" | 9 #include "SkBitmapProcState_filter.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| 11 #include "SkFilterProc.h" | 11 #include "SkFilterProc.h" |
| 12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
| 13 #include "SkShader.h" // for tilemodes | 13 #include "SkShader.h" // for tilemodes |
| 14 #include "SkUtilsArm.h" | 14 #include "SkUtilsArm.h" |
| 15 | 15 |
| 16 // Required to ensure the table is part of the final binary. | 16 // Required to ensure the table is part of the final binary. |
| 17 extern const SkBitmapProcState::SampleProc32 gSkBitmapProcStateSample32_neon[]; | 17 extern const SkBitmapProcState::SampleProc32 gSkBitmapProcStateSample32_neon[]; |
| 18 extern const SkBitmapProcState::SampleProc16 gSkBitmapProcStateSample16_neon[]; | |
| 19 | 18 |
| 20 #define NAME_WRAP(x) x ## _neon | 19 #define NAME_WRAP(x) x ## _neon |
| 21 #include "SkBitmapProcState_filter_neon.h" | 20 #include "SkBitmapProcState_filter_neon.h" |
| 22 #include "SkBitmapProcState_procs.h" | 21 #include "SkBitmapProcState_procs.h" |
| 23 | 22 |
| 24 const SkBitmapProcState::SampleProc32 gSkBitmapProcStateSample32_neon[] = { | 23 const SkBitmapProcState::SampleProc32 gSkBitmapProcStateSample32_neon[] = { |
| 25 S32_opaque_D32_nofilter_DXDY_neon, | 24 S32_opaque_D32_nofilter_DXDY_neon, |
| 26 S32_alpha_D32_nofilter_DXDY_neon, | 25 S32_alpha_D32_nofilter_DXDY_neon, |
| 27 S32_opaque_D32_nofilter_DX_neon, | 26 S32_opaque_D32_nofilter_DX_neon, |
| 28 S32_alpha_D32_nofilter_DX_neon, | 27 S32_alpha_D32_nofilter_DX_neon, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 SG8_alpha_D32_nofilter_DXDY_neon, | 71 SG8_alpha_D32_nofilter_DXDY_neon, |
| 73 SG8_alpha_D32_nofilter_DXDY_neon, | 72 SG8_alpha_D32_nofilter_DXDY_neon, |
| 74 SG8_alpha_D32_nofilter_DX_neon, | 73 SG8_alpha_D32_nofilter_DX_neon, |
| 75 SG8_alpha_D32_nofilter_DX_neon, | 74 SG8_alpha_D32_nofilter_DX_neon, |
| 76 SG8_alpha_D32_filter_DXDY_neon, | 75 SG8_alpha_D32_filter_DXDY_neon, |
| 77 SG8_alpha_D32_filter_DXDY_neon, | 76 SG8_alpha_D32_filter_DXDY_neon, |
| 78 SG8_alpha_D32_filter_DX_neon, | 77 SG8_alpha_D32_filter_DX_neon, |
| 79 SG8_alpha_D32_filter_DX_neon, | 78 SG8_alpha_D32_filter_DX_neon, |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 const SkBitmapProcState::SampleProc16 gSkBitmapProcStateSample16_neon[] = { | |
| 83 S32_D16_nofilter_DXDY_neon, | |
| 84 S32_D16_nofilter_DX_neon, | |
| 85 S32_D16_filter_DXDY_neon, | |
| 86 S32_D16_filter_DX_neon, | |
| 87 | |
| 88 S16_D16_nofilter_DXDY_neon, | |
| 89 S16_D16_nofilter_DX_neon, | |
| 90 S16_D16_filter_DXDY_neon, | |
| 91 S16_D16_filter_DX_neon, | |
| 92 | |
| 93 SI8_D16_nofilter_DXDY_neon, | |
| 94 SI8_D16_nofilter_DX_neon, | |
| 95 SI8_D16_filter_DXDY_neon, | |
| 96 SI8_D16_filter_DX_neon, | |
| 97 | |
| 98 // Don't support 4444 -> 565 | |
| 99 nullptr, nullptr, nullptr, nullptr, | |
| 100 // Don't support A8 -> 565 | |
| 101 nullptr, nullptr, nullptr, nullptr, | |
| 102 // Don't support G8 -> 565 (but we could) | |
| 103 nullptr, nullptr, nullptr, nullptr, | |
| 104 }; | |
| 105 | |
| 106 /////////////////////////////////////////////////////////////////////////////// | 81 /////////////////////////////////////////////////////////////////////////////// |
| 107 | 82 |
| 108 #include <arm_neon.h> | 83 #include <arm_neon.h> |
| 109 #include "SkConvolver.h" | 84 #include "SkConvolver.h" |
| 110 | 85 |
| 111 // Convolves horizontally along a single row. The row data is given in | 86 // Convolves horizontally along a single row. The row data is given in |
| 112 // |srcData| and continues for the numValues() of the filter. | 87 // |srcData| and continues for the numValues() of the filter. |
| 113 void convolveHorizontally_neon(const unsigned char* srcData, | 88 void convolveHorizontally_neon(const unsigned char* srcData, |
| 114 const SkConvolutionFilter1D& filter, | 89 const SkConvolutionFilter1D& filter, |
| 115 unsigned char* outRow, | 90 unsigned char* outRow, |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 } | 490 } |
| 516 } | 491 } |
| 517 | 492 |
| 518 void platformConvolutionProcs_arm_neon(SkConvolutionProcs* procs) { | 493 void platformConvolutionProcs_arm_neon(SkConvolutionProcs* procs) { |
| 519 procs->fExtraHorizontalReads = 3; | 494 procs->fExtraHorizontalReads = 3; |
| 520 procs->fConvolveVertically = &convolveVertically_neon; | 495 procs->fConvolveVertically = &convolveVertically_neon; |
| 521 procs->fConvolve4RowsHorizontally = &convolve4RowsHorizontally_neon; | 496 procs->fConvolve4RowsHorizontally = &convolve4RowsHorizontally_neon; |
| 522 procs->fConvolveHorizontally = &convolveHorizontally_neon; | 497 procs->fConvolveHorizontally = &convolveHorizontally_neon; |
| 523 procs->fApplySIMDPadding = &applySIMDPadding_neon; | 498 procs->fApplySIMDPadding = &applySIMDPadding_neon; |
| 524 } | 499 } |
| OLD | NEW |