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" |
11 #include "SkBitmapScaler.h" | 11 #include "SkBitmapScaler.h" |
12 #include "SkBlitMask.h" | 12 #include "SkBlitMask.h" |
13 #include "SkBlitRow.h" | 13 #include "SkBlitRow.h" |
14 #include "SkBlitRow_opts_SSE2.h" | 14 #include "SkBlitRow_opts_SSE2.h" |
15 #include "SkBlitRow_opts_SSE4.h" | |
16 #include "SkOncePtr.h" | 15 #include "SkOncePtr.h" |
17 #include "SkRTConf.h" | 16 #include "SkRTConf.h" |
18 | 17 |
19 #if defined(_MSC_VER) && defined(_WIN64) | 18 #if defined(_MSC_VER) && defined(_WIN64) |
20 #include <intrin.h> | 19 #include <intrin.h> |
21 #endif | 20 #endif |
22 | 21 |
23 /* This file must *not* be compiled with -msse or any other optional SIMD | 22 /* This file must *not* be compiled with -msse or any other optional SIMD |
24 extension, otherwise gcc may generate SIMD instructions even for scalar ops | 23 extension, otherwise gcc may generate SIMD instructions even for scalar ops |
25 (and thus give an invalid instruction on Pentium3 on the code below). | 24 (and thus give an invalid instruction on Pentium3 on the code below). |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 207 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
209 return platform_565_colorprocs_SSE2[flags]; | 208 return platform_565_colorprocs_SSE2[flags]; |
210 } else { | 209 } else { |
211 return nullptr; | 210 return nullptr; |
212 } | 211 } |
213 } | 212 } |
214 | 213 |
215 static const SkBlitRow::Proc32 platform_32_procs_SSE2[] = { | 214 static const SkBlitRow::Proc32 platform_32_procs_SSE2[] = { |
216 nullptr, // S32_Opaque, | 215 nullptr, // S32_Opaque, |
217 S32_Blend_BlitRow32_SSE2, // S32_Blend, | 216 S32_Blend_BlitRow32_SSE2, // S32_Blend, |
218 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque | 217 nullptr, // Ported to SkOpts |
219 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, | |
220 }; | |
221 | |
222 static const SkBlitRow::Proc32 platform_32_procs_SSE4[] = { | |
223 nullptr, // S32_Opaque, | |
224 S32_Blend_BlitRow32_SSE2, // S32_Blend, | |
225 S32A_Opaque_BlitRow32_SSE4, // S32A_Opaque | |
226 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, | 218 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, |
227 }; | 219 }; |
228 | 220 |
229 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { | 221 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { |
230 if (supports_simd(SK_CPU_SSE_LEVEL_SSE41)) { | |
231 return platform_32_procs_SSE4[flags]; | |
232 } else | |
233 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 222 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
234 return platform_32_procs_SSE2[flags]; | 223 return platform_32_procs_SSE2[flags]; |
235 } else { | 224 } else { |
236 return nullptr; | 225 return nullptr; |
237 } | 226 } |
238 } | 227 } |
239 | 228 |
240 //////////////////////////////////////////////////////////////////////////////// | 229 //////////////////////////////////////////////////////////////////////////////// |
241 | 230 |
242 SkBlitMask::BlitLCD16RowProc SkBlitMask::PlatformBlitRowProcs16(bool isOpaque) { | 231 SkBlitMask::BlitLCD16RowProc SkBlitMask::PlatformBlitRowProcs16(bool isOpaque) { |
243 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 232 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
244 if (isOpaque) { | 233 if (isOpaque) { |
245 return SkBlitLCD16OpaqueRow_SSE2; | 234 return SkBlitLCD16OpaqueRow_SSE2; |
246 } else { | 235 } else { |
247 return SkBlitLCD16Row_SSE2; | 236 return SkBlitLCD16Row_SSE2; |
248 } | 237 } |
249 } else { | 238 } else { |
250 return nullptr; | 239 return nullptr; |
251 } | 240 } |
252 | 241 |
253 } | 242 } |
254 | 243 |
255 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { | 244 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { |
256 return nullptr; | 245 return nullptr; |
257 } | 246 } |
OLD | NEW |