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