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

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

Issue 1270573002: Port SkUtils opts to SkOpts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: derek Created 5 years, 4 months 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/SkUtils_opts_none.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"
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" 15 #include "SkBlitRow_opts_SSE4.h"
16 #include "SkBlurImage_opts_SSE2.h" 16 #include "SkBlurImage_opts_SSE2.h"
17 #include "SkBlurImage_opts_SSE4.h" 17 #include "SkBlurImage_opts_SSE4.h"
18 #include "SkLazyPtr.h" 18 #include "SkLazyPtr.h"
19 #include "SkMorphology_opts.h" 19 #include "SkMorphology_opts.h"
20 #include "SkMorphology_opts_SSE2.h" 20 #include "SkMorphology_opts_SSE2.h"
21 #include "SkRTConf.h" 21 #include "SkRTConf.h"
22 #include "SkUtils.h"
23 #include "SkUtils_opts_SSE2.h"
24 22
25 #if defined(_MSC_VER) && defined(_WIN64) 23 #if defined(_MSC_VER) && defined(_WIN64)
26 #include <intrin.h> 24 #include <intrin.h>
27 #endif 25 #endif
28 26
29 /* This file must *not* be compiled with -msse or any other optional SIMD 27 /* This file must *not* be compiled with -msse or any other optional SIMD
30 extension, otherwise gcc may generate SIMD instructions even for scalar ops 28 extension, otherwise gcc may generate SIMD instructions even for scalar ops
31 (and thus give an invalid instruction on Pentium3 on the code below). 29 (and thus give an invalid instruction on Pentium3 on the code below).
32 For example, only files named *_SSE2.cpp in this directory should be 30 For example, only files named *_SSE2.cpp in this directory should be
33 compiled with -msse2 or higher. */ 31 compiled with -msse2 or higher. */
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 292 }
295 293
296 } 294 }
297 295
298 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro wFlags) { 296 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro wFlags) {
299 return NULL; 297 return NULL;
300 } 298 }
301 299
302 //////////////////////////////////////////////////////////////////////////////// 300 ////////////////////////////////////////////////////////////////////////////////
303 301
304 SkMemset16Proc SkMemset16GetPlatformProc() {
305 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
306 return sk_memset16_SSE2;
307 } else {
308 return NULL;
309 }
310 }
311
312 SkMemset32Proc SkMemset32GetPlatformProc() {
313 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
314 return sk_memset32_SSE2;
315 } else {
316 return NULL;
317 }
318 }
319
320 ////////////////////////////////////////////////////////////////////////////////
321
322 SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType t ype) { 302 SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType t ype) {
323 if (!supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { 303 if (!supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
324 return NULL; 304 return NULL;
325 } 305 }
326 switch (type) { 306 switch (type) {
327 case kDilateX_SkMorphologyProcType: 307 case kDilateX_SkMorphologyProcType:
328 return SkDilateX_SSE2; 308 return SkDilateX_SSE2;
329 case kDilateY_SkMorphologyProcType: 309 case kDilateY_SkMorphologyProcType:
330 return SkDilateY_SSE2; 310 return SkDilateY_SSE2;
331 case kErodeX_SkMorphologyProcType: 311 case kErodeX_SkMorphologyProcType:
(...skipping 11 matching lines...) Expand all
343 SkBoxBlurProc* boxBlurXY, 323 SkBoxBlurProc* boxBlurXY,
344 SkBoxBlurProc* boxBlurYX) { 324 SkBoxBlurProc* boxBlurYX) {
345 if (supports_simd(SK_CPU_SSE_LEVEL_SSE41)) { 325 if (supports_simd(SK_CPU_SSE_LEVEL_SSE41)) {
346 return SkBoxBlurGetPlatformProcs_SSE4(boxBlurX, boxBlurXY, boxBlurYX); 326 return SkBoxBlurGetPlatformProcs_SSE4(boxBlurX, boxBlurXY, boxBlurYX);
347 } 327 }
348 else if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { 328 else if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) {
349 return SkBoxBlurGetPlatformProcs_SSE2(boxBlurX, boxBlurXY, boxBlurYX); 329 return SkBoxBlurGetPlatformProcs_SSE2(boxBlurX, boxBlurXY, boxBlurYX);
350 } 330 }
351 return false; 331 return false;
352 } 332 }
OLDNEW
« no previous file with comments | « src/opts/SkUtils_opts_none.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698