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" |
11 #include "SkPaint.h" | 11 #include "SkPaint.h" |
12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
13 #include "SkUtils.h" | 13 #include "SkUtils.h" |
14 #include "SkUtilsArm.h" | 14 #include "SkUtilsArm.h" |
15 | 15 |
16 #include "SkConvolver.h" | 16 #include "SkConvolver.h" |
17 | 17 |
18 #if !defined(SK_CPU_ARM64) && SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN) | 18 #if SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN) |
19 void SI8_D16_nofilter_DX_arm( | 19 void SI8_D16_nofilter_DX_arm( |
20 const SkBitmapProcState& s, | 20 const SkBitmapProcState& s, |
21 const uint32_t* SK_RESTRICT xy, | 21 const uint32_t* SK_RESTRICT xy, |
22 int count, | 22 int count, |
23 uint16_t* SK_RESTRICT colors) SK_ATTRIBUTE_OPTIMIZE_O1; | 23 uint16_t* SK_RESTRICT colors) SK_ATTRIBUTE_OPTIMIZE_O1; |
24 | 24 |
25 void SI8_D16_nofilter_DX_arm(const SkBitmapProcState& s, | 25 void SI8_D16_nofilter_DX_arm(const SkBitmapProcState& s, |
26 const uint32_t* SK_RESTRICT xy, | 26 const uint32_t* SK_RESTRICT xy, |
27 int count, uint16_t* SK_RESTRICT colors) { | 27 int count, uint16_t* SK_RESTRICT colors) { |
28 SkASSERT(count > 0 && colors != NULL); | 28 SkASSERT(count > 0 && colors != NULL); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 "bne 3b \n\t" // loop if counter
!= 0 | 179 "bne 3b \n\t" // loop if counter
!= 0 |
180 "4: \n\t" // exit | 180 "4: \n\t" // exit |
181 : [xx] "+r" (xx), [count] "+r" (count), [colors] "+r" (colors) | 181 : [xx] "+r" (xx), [count] "+r" (count), [colors] "+r" (colors) |
182 : [table] "r" (table), [srcAddr] "r" (srcAddr) | 182 : [table] "r" (table), [srcAddr] "r" (srcAddr) |
183 : "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11" | 183 : "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11" |
184 ); | 184 ); |
185 } | 185 } |
186 | 186 |
187 s.fBitmap->getColorTable()->unlockColors(); | 187 s.fBitmap->getColorTable()->unlockColors(); |
188 } | 188 } |
189 #endif // !defined(SK_CPU_ARM64) && SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN) | 189 #endif // SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN) |
190 | 190 |
191 /////////////////////////////////////////////////////////////////////////////// | 191 /////////////////////////////////////////////////////////////////////////////// |
192 | 192 |
193 /* If we replace a sampleproc, then we null-out the associated shaderproc, | 193 /* If we replace a sampleproc, then we null-out the associated shaderproc, |
194 otherwise the shader won't even look at the matrix/sampler | 194 otherwise the shader won't even look at the matrix/sampler |
195 */ | 195 */ |
196 void SkBitmapProcState::platformProcs() { | 196 void SkBitmapProcState::platformProcs() { |
197 #if !defined(SK_CPU_ARM64) && SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN) | |
198 bool isOpaque = 256 == fAlphaScale; | 197 bool isOpaque = 256 == fAlphaScale; |
199 bool justDx = false; | 198 bool justDx = false; |
200 | 199 |
201 if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) { | 200 if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) { |
202 justDx = true; | 201 justDx = true; |
203 } | 202 } |
204 | 203 |
205 switch (fBitmap->config()) { | 204 switch (fBitmap->config()) { |
206 case SkBitmap::kIndex8_Config: | 205 case SkBitmap::kIndex8_Config: |
| 206 #if SK_ARM_ARCH >= 6 && !defined(SK_CPU_BENDIAN) |
207 if (justDx && SkPaint::kNone_FilterLevel == fFilterLevel) { | 207 if (justDx && SkPaint::kNone_FilterLevel == fFilterLevel) { |
208 #if 0 /* crashing on android device */ | 208 #if 0 /* crashing on android device */ |
209 fSampleProc16 = SI8_D16_nofilter_DX_arm; | 209 fSampleProc16 = SI8_D16_nofilter_DX_arm; |
210 fShaderProc16 = NULL; | 210 fShaderProc16 = NULL; |
211 #endif | 211 #endif |
212 if (isOpaque) { | 212 if (isOpaque) { |
213 // this one is only very slighty faster than the C version | 213 // this one is only very slighty faster than the C version |
214 fSampleProc32 = SI8_opaque_D32_nofilter_DX_arm; | 214 fSampleProc32 = SI8_opaque_D32_nofilter_DX_arm; |
215 fShaderProc32 = NULL; | 215 fShaderProc32 = NULL; |
216 } | 216 } |
217 } | 217 } |
| 218 #endif |
218 break; | 219 break; |
219 default: | 220 default: |
220 break; | 221 break; |
221 } | 222 } |
222 #endif | |
223 } | 223 } |
224 | 224 |
225 /////////////////////////////////////////////////////////////////////////////// | 225 /////////////////////////////////////////////////////////////////////////////// |
226 | 226 |
227 extern void platformConvolutionProcs_arm_neon(SkConvolutionProcs* procs); | 227 extern void platformConvolutionProcs_arm_neon(SkConvolutionProcs* procs); |
228 | 228 |
229 void platformConvolutionProcs_arm(SkConvolutionProcs* procs) { | 229 void platformConvolutionProcs_arm(SkConvolutionProcs* procs) { |
230 } | 230 } |
231 | 231 |
232 void SkBitmapProcState::platformConvolutionProcs(SkConvolutionProcs* procs) { | 232 void SkBitmapProcState::platformConvolutionProcs(SkConvolutionProcs* procs) { |
233 SK_ARM_NEON_WRAP(platformConvolutionProcs_arm)(procs); | 233 SK_ARM_NEON_WRAP(platformConvolutionProcs_arm)(procs); |
234 } | 234 } |
OLD | NEW |