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 "SkBlitMask.h" | 11 #include "SkBlitMask.h" |
12 #include "SkBlitRect_opts_SSE2.h" | 12 #include "SkBlitRect_opts_SSE2.h" |
13 #include "SkBlitRow.h" | 13 #include "SkBlitRow.h" |
14 #include "SkBlitRow_opts_SSE2.h" | 14 #include "SkBlitRow_opts_SSE2.h" |
15 #include "SkBlurImage_opts_SSE2.h" | 15 #include "SkBlurImage_opts_SSE2.h" |
16 #include "SkMorphology_opts.h" | 16 #include "SkMorphology_opts.h" |
17 #include "SkMorphology_opts_SSE2.h" | 17 #include "SkMorphology_opts_SSE2.h" |
18 #include "SkRTConf.h" | 18 #include "SkRTConf.h" |
19 #include "SkUtils.h" | 19 #include "SkUtils.h" |
20 #include "SkUtils_opts_SSE2.h" | 20 #include "SkUtils_opts_SSE2.h" |
21 #include "SkXfermode.h" | 21 #include "SkXfermode.h" |
22 #include "SkXfermode_proccoeff.h" | 22 #include "SkXfermode_proccoeff.h" |
23 | 23 |
| 24 // Temporarily disable everything but SSE2: crbug.com/372232. |
| 25 #if 1 |
| 26 static inline bool supports_simd(int minLevel) { |
| 27 SkASSERT(SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2); |
| 28 return minLevel <= SK_CPU_SSE_LEVEL_SSE2; |
| 29 } |
| 30 #else |
| 31 |
24 #if defined(_MSC_VER) && defined(_WIN64) | 32 #if defined(_MSC_VER) && defined(_WIN64) |
25 #include <intrin.h> | 33 #include <intrin.h> |
26 #endif | 34 #endif |
27 | 35 |
28 /* This file must *not* be compiled with -msse or any other optional SIMD | 36 /* This file must *not* be compiled with -msse or any other optional SIMD |
29 extension, otherwise gcc may generate SIMD instructions even for scalar ops | 37 extension, otherwise gcc may generate SIMD instructions even for scalar ops |
30 (and thus give an invalid instruction on Pentium3 on the code below). | 38 (and thus give an invalid instruction on Pentium3 on the code below). |
31 For example, only files named *_SSE2.cpp in this directory should be | 39 For example, only files named *_SSE2.cpp in this directory should be |
32 compiled with -msse2 or higher. */ | 40 compiled with -msse2 or higher. */ |
33 | 41 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 * instructions. So for that particular case we disable our SSSE3 option
s. | 117 * instructions. So for that particular case we disable our SSSE3 option
s. |
110 */ | 118 */ |
111 return false; | 119 return false; |
112 #else | 120 #else |
113 static int gSIMDLevel = get_SIMD_level(); | 121 static int gSIMDLevel = get_SIMD_level(); |
114 return (minLevel <= gSIMDLevel); | 122 return (minLevel <= gSIMDLevel); |
115 #endif | 123 #endif |
116 } | 124 } |
117 } | 125 } |
118 | 126 |
| 127 #endif // Temporarily disable everything but SSE2: crbug.com/372232. |
| 128 |
119 //////////////////////////////////////////////////////////////////////////////// | 129 //////////////////////////////////////////////////////////////////////////////// |
120 | 130 |
121 SK_CONF_DECLARE( bool, c_hqfilter_sse, "bitmap.filter.highQualitySSE", false, "U
se SSE optimized version of high quality image filters"); | 131 SK_CONF_DECLARE( bool, c_hqfilter_sse, "bitmap.filter.highQualitySSE", false, "U
se SSE optimized version of high quality image filters"); |
122 | 132 |
123 void SkBitmapProcState::platformConvolutionProcs(SkConvolutionProcs* procs) { | 133 void SkBitmapProcState::platformConvolutionProcs(SkConvolutionProcs* procs) { |
124 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { | 134 if (supports_simd(SK_CPU_SSE_LEVEL_SSE2)) { |
125 procs->fExtraHorizontalReads = 3; | 135 procs->fExtraHorizontalReads = 3; |
126 procs->fConvolveVertically = &convolveVertically_SSE2; | 136 procs->fConvolveVertically = &convolveVertically_SSE2; |
127 procs->fConvolve4RowsHorizontally = &convolve4RowsHorizontally_SSE2; | 137 procs->fConvolve4RowsHorizontally = &convolve4RowsHorizontally_SSE2; |
128 procs->fConvolveHorizontally = &convolveHorizontally_SSE2; | 138 procs->fConvolveHorizontally = &convolveHorizontally_SSE2; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } else { | 380 } else { |
371 return SkPlatformXfermodeFactory_impl(rec, mode); | 381 return SkPlatformXfermodeFactory_impl(rec, mode); |
372 } | 382 } |
373 } | 383 } |
374 | 384 |
375 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); | 385 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); |
376 | 386 |
377 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { | 387 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { |
378 return NULL; | 388 return NULL; |
379 } | 389 } |
OLD | NEW |