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" | |
9 #include "SkBitmapProcState_opts_SSE2.h" | 8 #include "SkBitmapProcState_opts_SSE2.h" |
10 #include "SkBitmapProcState_opts_SSSE3.h" | 9 #include "SkBitmapProcState_opts_SSSE3.h" |
11 #include "SkBitmapScaler.h" | 10 #include "SkBitmapScaler.h" |
12 #include "SkBlitMask.h" | 11 #include "SkBlitMask.h" |
13 #include "SkBlitRow.h" | 12 #include "SkBlitRow.h" |
14 #include "SkBlitRow_opts_SSE2.h" | 13 #include "SkBlitRow_opts_SSE2.h" |
15 #include "SkCpu.h" | 14 #include "SkCpu.h" |
16 | 15 |
17 | 16 |
18 /* | 17 /* |
19 ***************************************** | 18 ***************************************** |
20 *********This file is deprecated********* | 19 *********This file is deprecated********* |
21 ***************************************** | 20 ***************************************** |
22 * New CPU-specific work should be done in | 21 * New CPU-specific work should be done in |
23 * SkOpts framework. Run-time detection of | 22 * SkOpts framework. Run-time detection of |
24 * available instruction set extensions is | 23 * available instruction set extensions is |
25 * implemented in src/core/SkOpts.cpp file | 24 * implemented in src/core/SkOpts.cpp file |
26 ***************************************** | 25 ***************************************** |
27 */ | 26 */ |
28 | 27 |
29 | 28 |
30 /* This file must *not* be compiled with -msse or any other optional SIMD | 29 /* This file must *not* be compiled with -msse or any other optional SIMD |
31 extension, otherwise gcc may generate SIMD instructions even for scalar ops | 30 extension, otherwise gcc may generate SIMD instructions even for scalar ops |
32 (and thus give an invalid instruction on Pentium3 on the code below). | 31 (and thus give an invalid instruction on Pentium3 on the code below). |
33 For example, only files named *_SSE2.cpp in this directory should be | 32 For example, only files named *_SSE2.cpp in this directory should be |
34 compiled with -msse2 or higher. */ | 33 compiled with -msse2 or higher. */ |
35 | 34 |
36 //////////////////////////////////////////////////////////////////////////////// | 35 //////////////////////////////////////////////////////////////////////////////// |
37 | 36 |
38 void SkBitmapScaler::PlatformConvolutionProcs(SkConvolutionProcs* procs) { | |
39 if (SkCpu::Supports(SkCpu::SSE2)) { | |
40 procs->fConvolveVertically = &convolveVertically_SSE2; | |
41 procs->fConvolve4RowsHorizontally = &convolve4RowsHorizontally_SSE2; | |
42 procs->fConvolveHorizontally = &convolveHorizontally_SSE2; | |
43 } | |
44 } | |
45 | |
46 //////////////////////////////////////////////////////////////////////////////// | |
47 | |
48 void SkBitmapProcState::platformProcs() { | 37 void SkBitmapProcState::platformProcs() { |
49 /* Every optimization in the function requires at least SSE2 */ | 38 /* Every optimization in the function requires at least SSE2 */ |
50 if (!SkCpu::Supports(SkCpu::SSE2)) { | 39 if (!SkCpu::Supports(SkCpu::SSE2)) { |
51 return; | 40 return; |
52 } | 41 } |
53 const bool ssse3 = SkCpu::Supports(SkCpu::SSSE3); | 42 const bool ssse3 = SkCpu::Supports(SkCpu::SSSE3); |
54 | 43 |
55 /* Check fSampleProc32 */ | 44 /* Check fSampleProc32 */ |
56 if (fSampleProc32 == S32_opaque_D32_filter_DX) { | 45 if (fSampleProc32 == S32_opaque_D32_filter_DX) { |
57 if (ssse3) { | 46 if (ssse3) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 141 } |
153 } else { | 142 } else { |
154 return nullptr; | 143 return nullptr; |
155 } | 144 } |
156 | 145 |
157 } | 146 } |
158 | 147 |
159 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { | 148 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { |
160 return nullptr; | 149 return nullptr; |
161 } | 150 } |
OLD | NEW |