| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The Android Open Source Project | 2 * Copyright 2009 The Android Open Source Project |
| 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 | 8 |
| 9 #include "SkBitmapProcState.h" | 9 #include "SkBitmapProcState.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 // Padding |paddingCount| of more dummy coefficients after the coefficients | 394 // Padding |paddingCount| of more dummy coefficients after the coefficients |
| 395 // of last filter to prevent SIMD instructions which load 8 or 16 bytes | 395 // of last filter to prevent SIMD instructions which load 8 or 16 bytes |
| 396 // together to access invalid memory areas. We are not trying to align the | 396 // together to access invalid memory areas. We are not trying to align the |
| 397 // coefficients right now due to the opaqueness of <vector> implementation. | 397 // coefficients right now due to the opaqueness of <vector> implementation. |
| 398 // This has to be done after all |AddFilter| calls. | 398 // This has to be done after all |AddFilter| calls. |
| 399 for (int i = 0; i < 8; ++i) { | 399 for (int i = 0; i < 8; ++i) { |
| 400 filter->addFilterValue(static_cast<SkConvolutionFilter1D::ConvolutionFix
ed>(0)); | 400 filter->addFilterValue(static_cast<SkConvolutionFilter1D::ConvolutionFix
ed>(0)); |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 void SkBitmapProcState::platformConvolutionProcs() { | 404 void SkBitmapProcState::platformConvolutionProcs(SkConvolutionProcs* procs) { |
| 405 if (sk_cpu_arm_has_neon()) { | 405 if (sk_cpu_arm_has_neon()) { |
| 406 fConvolutionProcs->fExtraHorizontalReads = 3; | 406 procs->fExtraHorizontalReads = 3; |
| 407 fConvolutionProcs->fConvolveVertically = &convolveVertically_arm; | 407 procs->fConvolveVertically = &convolveVertically_arm; |
| 408 | 408 |
| 409 // next line is commented out because the four-row convolution function
above is | 409 // next line is commented out because the four-row convolution function
above is |
| 410 // just a no-op. Please see the comment above its definition, and the S
SE implementation | 410 // just a no-op. Please see the comment above its definition, and the S
SE implementation |
| 411 // in SkBitmapProcState_opts_SSE2.cpp for guidance on its semantics. | 411 // in SkBitmapProcState_opts_SSE2.cpp for guidance on its semantics. |
| 412 // leaving it as NULL will just cause the convolution system to not atte
mpt | 412 // leaving it as NULL will just cause the convolution system to not atte
mpt |
| 413 // to operate on four rows at once, which is correct but not performance
-optimal. | 413 // to operate on four rows at once, which is correct but not performance
-optimal. |
| 414 | 414 |
| 415 // fConvolutionProcs->fConvolve4RowsHorizontally = &convolve4RowsHorizon
tally_arm; | 415 // procs->fConvolve4RowsHorizontally = &convolve4RowsHorizontally_arm; |
| 416 | 416 |
| 417 fConvolutionProcs->fConvolve4RowsHorizontally = NULL; | 417 procs->fConvolve4RowsHorizontally = NULL; |
| 418 | 418 |
| 419 fConvolutionProcs->fConvolveHorizontally = &convolveHorizontally_arm; | 419 procs->fConvolveHorizontally = &convolveHorizontally_arm; |
| 420 fConvolutionProcs->fApplySIMDPadding = &applySIMDPadding_arm; | 420 procs->fApplySIMDPadding = &applySIMDPadding_arm; |
| 421 } | 421 } |
| 422 } | 422 } |
| OLD | NEW |