| 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 "SkBitmapProcState_opts_SSE2.h" | 8 #include "SkBitmapProcState_opts_SSE2.h" |
| 9 #include "SkBitmapProcState_opts_SSSE3.h" | 9 #include "SkBitmapProcState_opts_SSSE3.h" |
| 10 #include "SkBitmapFilter_opts_SSE2.h" | 10 #include "SkBitmapFilter_opts_SSE2.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 return gHasSSE2; | 100 return gHasSSE2; |
| 101 } | 101 } |
| 102 | 102 |
| 103 static bool cachedHasSSSE3() { | 103 static bool cachedHasSSSE3() { |
| 104 static bool gHasSSSE3 = hasSSSE3(); | 104 static bool gHasSSSE3 = hasSSSE3(); |
| 105 return gHasSSSE3; | 105 return gHasSSSE3; |
| 106 } | 106 } |
| 107 | 107 |
| 108 SK_CONF_DECLARE( bool, c_hqfilter_sse, "bitmap.filter.highQualitySSE", false, "U
se SSE optimized version of high quality image filters"); | 108 SK_CONF_DECLARE( bool, c_hqfilter_sse, "bitmap.filter.highQualitySSE", false, "U
se SSE optimized version of high quality image filters"); |
| 109 | 109 |
| 110 void SkBitmapProcState::platformConvolutionProcs() { |
| 111 if (cachedHasSSE2()) { |
| 112 fConvolutionProcs->fExtraHorizontalReads = 3; |
| 113 fConvolutionProcs->fConvolveVertically = &convolveVertically_SSE2; |
| 114 fConvolutionProcs->fConvolve4RowsHorizontally = &convolve4RowsHorizontal
ly_SSE2; |
| 115 fConvolutionProcs->fConvolveHorizontally = &convolveHorizontally_SSE2; |
| 116 fConvolutionProcs->fApplySIMDPadding = &applySIMDPadding_SSE2; |
| 117 } |
| 118 } |
| 119 |
| 110 void SkBitmapProcState::platformProcs() { | 120 void SkBitmapProcState::platformProcs() { |
| 111 if (cachedHasSSSE3()) { | 121 if (cachedHasSSSE3()) { |
| 112 #if !defined(SK_BUILD_FOR_ANDROID) | 122 #if !defined(SK_BUILD_FOR_ANDROID) |
| 113 // Disable SSSE3 optimization for Android x86 | 123 // Disable SSSE3 optimization for Android x86 |
| 114 if (fSampleProc32 == S32_opaque_D32_filter_DX) { | 124 if (fSampleProc32 == S32_opaque_D32_filter_DX) { |
| 115 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3; | 125 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3; |
| 116 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) { | 126 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) { |
| 117 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3; | 127 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3; |
| 118 } | 128 } |
| 119 | 129 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 144 | 154 |
| 145 if (fMatrixProc == ClampX_ClampY_filter_affine) { | 155 if (fMatrixProc == ClampX_ClampY_filter_affine) { |
| 146 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; | 156 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; |
| 147 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { | 157 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { |
| 148 fMatrixProc = ClampX_ClampY_nofilter_affine_SSE2; | 158 fMatrixProc = ClampX_ClampY_nofilter_affine_SSE2; |
| 149 } | 159 } |
| 150 if (c_hqfilter_sse) { | 160 if (c_hqfilter_sse) { |
| 151 if (fShaderProc32 == highQualityFilter) { | 161 if (fShaderProc32 == highQualityFilter) { |
| 152 fShaderProc32 = highQualityFilter_SSE2; | 162 fShaderProc32 = highQualityFilter_SSE2; |
| 153 } | 163 } |
| 154 if (fShaderProc32 == highQualityFilter_ScaleOnly) { | |
| 155 fShaderProc32 = highQualityFilter_ScaleOnly_SSE2; | |
| 156 } | |
| 157 } | 164 } |
| 158 } | 165 } |
| 159 } | 166 } |
| 160 | 167 |
| 161 static SkBlitRow::Proc32 platform_32_procs[] = { | 168 static SkBlitRow::Proc32 platform_32_procs[] = { |
| 162 NULL, // S32_Opaque, | 169 NULL, // S32_Opaque, |
| 163 S32_Blend_BlitRow32_SSE2, // S32_Blend, | 170 S32_Blend_BlitRow32_SSE2, // S32_Blend, |
| 164 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque | 171 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque |
| 165 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, | 172 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, |
| 166 }; | 173 }; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 253 |
| 247 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning | 254 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning |
| 248 | 255 |
| 249 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { | 256 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { |
| 250 if (cachedHasSSE2()) { | 257 if (cachedHasSSE2()) { |
| 251 return ColorRect32_SSE2; | 258 return ColorRect32_SSE2; |
| 252 } else { | 259 } else { |
| 253 return NULL; | 260 return NULL; |
| 254 } | 261 } |
| 255 } | 262 } |
| OLD | NEW |