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 #include "SkBitmapFilter_opts_SSE2.h" | 8 #include "SkBitmapFilter_opts_SSE2.h" |
9 #include "SkBitmapProcState_opts_SSE2.h" | 9 #include "SkBitmapProcState_opts_SSE2.h" |
10 #include "SkBitmapProcState_opts_SSSE3.h" | 10 #include "SkBitmapProcState_opts_SSSE3.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 //////////////////////////////////////////////////////////////////////////////// | 145 //////////////////////////////////////////////////////////////////////////////// |
146 | 146 |
147 void SkBitmapProcState::platformProcs() { | 147 void SkBitmapProcState::platformProcs() { |
148 /* Every optimization in the function requires at least SSE2 */ | 148 /* Every optimization in the function requires at least SSE2 */ |
149 if (!supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 149 if (!supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
150 return; | 150 return; |
151 } | 151 } |
152 const bool ssse3 = supports_simd(SK_CPU_SSE_LEVEL_SSSE3); | |
153 | 152 |
154 /* Check fSampleProc32 */ | 153 /* Check fSampleProc32 */ |
155 if (fSampleProc32 == S32_opaque_D32_filter_DX) { | 154 if (fSampleProc32 == S32_opaque_D32_filter_DX) { |
156 if (ssse3) { | 155 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { |
157 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3; | 156 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3; |
158 } else { | 157 } else { |
159 fSampleProc32 = S32_opaque_D32_filter_DX_SSE2; | 158 fSampleProc32 = S32_opaque_D32_filter_DX_SSE2; |
160 } | 159 } |
161 } else if (fSampleProc32 == S32_opaque_D32_filter_DXDY) { | 160 } else if (fSampleProc32 == S32_opaque_D32_filter_DXDY) { |
162 if (ssse3) { | 161 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { |
163 fSampleProc32 = S32_opaque_D32_filter_DXDY_SSSE3; | 162 fSampleProc32 = S32_opaque_D32_filter_DXDY_SSSE3; |
164 } | 163 } |
165 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) { | 164 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) { |
166 if (ssse3) { | 165 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { |
167 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3; | 166 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3; |
168 } else { | 167 } else { |
169 fSampleProc32 = S32_alpha_D32_filter_DX_SSE2; | 168 fSampleProc32 = S32_alpha_D32_filter_DX_SSE2; |
170 } | 169 } |
171 } else if (fSampleProc32 == S32_alpha_D32_filter_DXDY) { | 170 } else if (fSampleProc32 == S32_alpha_D32_filter_DXDY) { |
172 if (ssse3) { | 171 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { |
173 fSampleProc32 = S32_alpha_D32_filter_DXDY_SSSE3; | 172 fSampleProc32 = S32_alpha_D32_filter_DXDY_SSSE3; |
174 } | 173 } |
175 } | 174 } |
176 | 175 |
177 /* Check fSampleProc16 */ | 176 /* Check fSampleProc16 */ |
178 if (fSampleProc16 == S32_D16_filter_DX) { | 177 if (fSampleProc16 == S32_D16_filter_DX) { |
179 fSampleProc16 = S32_D16_filter_DX_SSE2; | 178 fSampleProc16 = S32_D16_filter_DX_SSE2; |
180 } else if (ssse3 && fSampleProc16 == S32_D16_filter_DXDY) { | |
181 fSampleProc16 = S32_D16_filter_DXDY_SSSE3; | |
182 } | 179 } |
183 | 180 |
184 /* Check fMatrixProc */ | 181 /* Check fMatrixProc */ |
185 if (fMatrixProc == ClampX_ClampY_filter_scale) { | 182 if (fMatrixProc == ClampX_ClampY_filter_scale) { |
186 fMatrixProc = ClampX_ClampY_filter_scale_SSE2; | 183 fMatrixProc = ClampX_ClampY_filter_scale_SSE2; |
187 } else if (fMatrixProc == ClampX_ClampY_nofilter_scale) { | 184 } else if (fMatrixProc == ClampX_ClampY_nofilter_scale) { |
188 fMatrixProc = ClampX_ClampY_nofilter_scale_SSE2; | 185 fMatrixProc = ClampX_ClampY_nofilter_scale_SSE2; |
189 } else if (fMatrixProc == ClampX_ClampY_filter_affine) { | 186 } else if (fMatrixProc == ClampX_ClampY_filter_affine) { |
190 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; | 187 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; |
191 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { | 188 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 } else { | 399 } else { |
403 return SkPlatformXfermodeFactory_impl(rec, mode); | 400 return SkPlatformXfermodeFactory_impl(rec, mode); |
404 } | 401 } |
405 } | 402 } |
406 | 403 |
407 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); | 404 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); |
408 | 405 |
409 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { | 406 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { |
410 return NULL; | 407 return NULL; |
411 } | 408 } |
OLD | NEW |