Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: src/opts/opts_check_x86.cpp

Issue 773753002: Add SSSE3 acceleration for S32_D16_filter_DXDY (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix build failure without SSSE3 Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/opts/SkBitmapProcState_opts_SSSE3.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
152 153
153 /* Check fSampleProc32 */ 154 /* Check fSampleProc32 */
154 if (fSampleProc32 == S32_opaque_D32_filter_DX) { 155 if (fSampleProc32 == S32_opaque_D32_filter_DX) {
155 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { 156 if (ssse3) {
156 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3; 157 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3;
157 } else { 158 } else {
158 fSampleProc32 = S32_opaque_D32_filter_DX_SSE2; 159 fSampleProc32 = S32_opaque_D32_filter_DX_SSE2;
159 } 160 }
160 } else if (fSampleProc32 == S32_opaque_D32_filter_DXDY) { 161 } else if (fSampleProc32 == S32_opaque_D32_filter_DXDY) {
161 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { 162 if (ssse3) {
162 fSampleProc32 = S32_opaque_D32_filter_DXDY_SSSE3; 163 fSampleProc32 = S32_opaque_D32_filter_DXDY_SSSE3;
163 } 164 }
164 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) { 165 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) {
165 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { 166 if (ssse3) {
166 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3; 167 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3;
167 } else { 168 } else {
168 fSampleProc32 = S32_alpha_D32_filter_DX_SSE2; 169 fSampleProc32 = S32_alpha_D32_filter_DX_SSE2;
169 } 170 }
170 } else if (fSampleProc32 == S32_alpha_D32_filter_DXDY) { 171 } else if (fSampleProc32 == S32_alpha_D32_filter_DXDY) {
171 if (supports_simd(SK_CPU_SSE_LEVEL_SSSE3)) { 172 if (ssse3) {
172 fSampleProc32 = S32_alpha_D32_filter_DXDY_SSSE3; 173 fSampleProc32 = S32_alpha_D32_filter_DXDY_SSSE3;
173 } 174 }
174 } 175 }
175 176
176 /* Check fSampleProc16 */ 177 /* Check fSampleProc16 */
177 if (fSampleProc16 == S32_D16_filter_DX) { 178 if (fSampleProc16 == S32_D16_filter_DX) {
178 fSampleProc16 = S32_D16_filter_DX_SSE2; 179 fSampleProc16 = S32_D16_filter_DX_SSE2;
180 } else if (ssse3 && fSampleProc16 == S32_D16_filter_DXDY) {
181 fSampleProc16 = S32_D16_filter_DXDY_SSSE3;
179 } 182 }
180 183
181 /* Check fMatrixProc */ 184 /* Check fMatrixProc */
182 if (fMatrixProc == ClampX_ClampY_filter_scale) { 185 if (fMatrixProc == ClampX_ClampY_filter_scale) {
183 fMatrixProc = ClampX_ClampY_filter_scale_SSE2; 186 fMatrixProc = ClampX_ClampY_filter_scale_SSE2;
184 } else if (fMatrixProc == ClampX_ClampY_nofilter_scale) { 187 } else if (fMatrixProc == ClampX_ClampY_nofilter_scale) {
185 fMatrixProc = ClampX_ClampY_nofilter_scale_SSE2; 188 fMatrixProc = ClampX_ClampY_nofilter_scale_SSE2;
186 } else if (fMatrixProc == ClampX_ClampY_filter_affine) { 189 } else if (fMatrixProc == ClampX_ClampY_filter_affine) {
187 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; 190 fMatrixProc = ClampX_ClampY_filter_affine_SSE2;
188 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { 191 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } else { 402 } else {
400 return SkPlatformXfermodeFactory_impl(rec, mode); 403 return SkPlatformXfermodeFactory_impl(rec, mode);
401 } 404 }
402 } 405 }
403 406
404 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); 407 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode);
405 408
406 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { 409 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) {
407 return NULL; 410 return NULL;
408 } 411 }
OLDNEW
« no previous file with comments | « src/opts/SkBitmapProcState_opts_SSSE3.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698