| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; | 183 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; |
| 184 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { | 184 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { |
| 185 fMatrixProc = ClampX_ClampY_nofilter_affine_SSE2; | 185 fMatrixProc = ClampX_ClampY_nofilter_affine_SSE2; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 //////////////////////////////////////////////////////////////////////////////// | 189 //////////////////////////////////////////////////////////////////////////////// |
| 190 | 190 |
| 191 static const SkBlitRow::Proc16 platform_16_procs[] = { | 191 static const SkBlitRow::Proc16 platform_16_procs[] = { |
| 192 S32_D565_Opaque_SSE2, // S32_D565_Opaque | 192 S32_D565_Opaque_SSE2, // S32_D565_Opaque |
| 193 NULL, // S32_D565_Blend | 193 nullptr, // S32_D565_Blend |
| 194 S32A_D565_Opaque_SSE2, // S32A_D565_Opaque | 194 S32A_D565_Opaque_SSE2, // S32A_D565_Opaque |
| 195 NULL, // S32A_D565_Blend | 195 nullptr, // S32A_D565_Blend |
| 196 S32_D565_Opaque_Dither_SSE2, // S32_D565_Opaque_Dither | 196 S32_D565_Opaque_Dither_SSE2, // S32_D565_Opaque_Dither |
| 197 NULL, // S32_D565_Blend_Dither | 197 nullptr, // S32_D565_Blend_Dither |
| 198 S32A_D565_Opaque_Dither_SSE2, // S32A_D565_Opaque_Dither | 198 S32A_D565_Opaque_Dither_SSE2, // S32A_D565_Opaque_Dither |
| 199 NULL, // S32A_D565_Blend_Dither | 199 nullptr, // S32A_D565_Blend_Dither |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 SkBlitRow::Proc16 SkBlitRow::PlatformFactory565(unsigned flags) { | 202 SkBlitRow::Proc16 SkBlitRow::PlatformFactory565(unsigned flags) { |
| 203 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 203 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
| 204 return platform_16_procs[flags]; | 204 return platform_16_procs[flags]; |
| 205 } else { | 205 } else { |
| 206 return NULL; | 206 return nullptr; |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 static const SkBlitRow::ColorProc16 platform_565_colorprocs_SSE2[] = { | 210 static const SkBlitRow::ColorProc16 platform_565_colorprocs_SSE2[] = { |
| 211 Color32A_D565_SSE2, // Color32A_D565, | 211 Color32A_D565_SSE2, // Color32A_D565, |
| 212 NULL, // Color32A_D565_Dither | 212 nullptr, // Color32A_D565_Dither |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) { | 215 SkBlitRow::ColorProc16 SkBlitRow::PlatformColorFactory565(unsigned flags) { |
| 216 /* If you're thinking about writing an SSE4 version of this, do check it's | 216 /* If you're thinking about writing an SSE4 version of this, do check it's |
| 217 * actually faster on Atom. Our original SSE4 version was slower than this | 217 * actually faster on Atom. Our original SSE4 version was slower than this |
| 218 * SSE2 version on Silvermont, and only marginally faster on a Core i7, | 218 * SSE2 version on Silvermont, and only marginally faster on a Core i7, |
| 219 * mainly due to the MULLD timings. | 219 * mainly due to the MULLD timings. |
| 220 */ | 220 */ |
| 221 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 221 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
| 222 return platform_565_colorprocs_SSE2[flags]; | 222 return platform_565_colorprocs_SSE2[flags]; |
| 223 } else { | 223 } else { |
| 224 return NULL; | 224 return nullptr; |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 static const SkBlitRow::Proc32 platform_32_procs_SSE2[] = { | 228 static const SkBlitRow::Proc32 platform_32_procs_SSE2[] = { |
| 229 NULL, // S32_Opaque, | 229 nullptr, // S32_Opaque, |
| 230 S32_Blend_BlitRow32_SSE2, // S32_Blend, | 230 S32_Blend_BlitRow32_SSE2, // S32_Blend, |
| 231 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque | 231 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque |
| 232 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, | 232 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 static const SkBlitRow::Proc32 platform_32_procs_SSE4[] = { | 235 static const SkBlitRow::Proc32 platform_32_procs_SSE4[] = { |
| 236 NULL, // S32_Opaque, | 236 nullptr, // S32_Opaque, |
| 237 S32_Blend_BlitRow32_SSE2, // S32_Blend, | 237 S32_Blend_BlitRow32_SSE2, // S32_Blend, |
| 238 S32A_Opaque_BlitRow32_SSE4, // S32A_Opaque | 238 S32A_Opaque_BlitRow32_SSE4, // S32A_Opaque |
| 239 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, | 239 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { | 242 SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { |
| 243 if (supports_simd(SK_CPU_SSE_LEVEL_SSE41)) { | 243 if (supports_simd(SK_CPU_SSE_LEVEL_SSE41)) { |
| 244 return platform_32_procs_SSE4[flags]; | 244 return platform_32_procs_SSE4[flags]; |
| 245 } else | 245 } else |
| 246 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 246 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
| 247 return platform_32_procs_SSE2[flags]; | 247 return platform_32_procs_SSE2[flags]; |
| 248 } else { | 248 } else { |
| 249 return NULL; | 249 return nullptr; |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 | 252 |
| 253 //////////////////////////////////////////////////////////////////////////////// | 253 //////////////////////////////////////////////////////////////////////////////// |
| 254 | 254 |
| 255 SkBlitMask::BlitLCD16RowProc SkBlitMask::PlatformBlitRowProcs16(bool isOpaque) { | 255 SkBlitMask::BlitLCD16RowProc SkBlitMask::PlatformBlitRowProcs16(bool isOpaque) { |
| 256 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 256 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
| 257 if (isOpaque) { | 257 if (isOpaque) { |
| 258 return SkBlitLCD16OpaqueRow_SSE2; | 258 return SkBlitLCD16OpaqueRow_SSE2; |
| 259 } else { | 259 } else { |
| 260 return SkBlitLCD16Row_SSE2; | 260 return SkBlitLCD16Row_SSE2; |
| 261 } | 261 } |
| 262 } else { | 262 } else { |
| 263 return NULL; | 263 return nullptr; |
| 264 } | 264 } |
| 265 | 265 |
| 266 } | 266 } |
| 267 | 267 |
| 268 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { | 268 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { |
| 269 return NULL; | 269 return nullptr; |
| 270 } | 270 } |
| OLD | NEW |