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" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 //////////////////////////////////////////////////////////////////////////////// | 69 //////////////////////////////////////////////////////////////////////////////// |
70 | 70 |
71 /* Fetch the SIMD level directly from the CPU, at run-time. | 71 /* Fetch the SIMD level directly from the CPU, at run-time. |
72 * Only checks the levels needed by the optimizations in this file. | 72 * Only checks the levels needed by the optimizations in this file. |
73 */ | 73 */ |
74 namespace { // get_SIMD_level() technically must have external linkage, so no s
tatic. | 74 namespace { // get_SIMD_level() technically must have external linkage, so no s
tatic. |
75 int* get_SIMD_level() { | 75 int* get_SIMD_level() { |
76 int cpu_info[4] = { 0, 0, 0, 0 }; | 76 int cpu_info[4] = { 0, 0, 0, 0 }; |
77 getcpuid(1, cpu_info); | 77 getcpuid(1, cpu_info); |
78 | 78 |
79 int* level = SkNEW(int); | 79 int* level = new int; |
80 | 80 |
81 if ((cpu_info[2] & (1<<20)) != 0) { | 81 if ((cpu_info[2] & (1<<20)) != 0) { |
82 *level = SK_CPU_SSE_LEVEL_SSE42; | 82 *level = SK_CPU_SSE_LEVEL_SSE42; |
83 } else if ((cpu_info[2] & (1<<19)) != 0) { | 83 } else if ((cpu_info[2] & (1<<19)) != 0) { |
84 *level = SK_CPU_SSE_LEVEL_SSE41; | 84 *level = SK_CPU_SSE_LEVEL_SSE41; |
85 } else if ((cpu_info[2] & (1<<9)) != 0) { | 85 } else if ((cpu_info[2] & (1<<9)) != 0) { |
86 *level = SK_CPU_SSE_LEVEL_SSSE3; | 86 *level = SK_CPU_SSE_LEVEL_SSSE3; |
87 } else if ((cpu_info[3] & (1<<26)) != 0) { | 87 } else if ((cpu_info[3] & (1<<26)) != 0) { |
88 *level = SK_CPU_SSE_LEVEL_SSE2; | 88 *level = SK_CPU_SSE_LEVEL_SSE2; |
89 } else { | 89 } else { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 } else { | 262 } else { |
263 return NULL; | 263 return NULL; |
264 } | 264 } |
265 | 265 |
266 } | 266 } |
267 | 267 |
268 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { | 268 SkBlitMask::RowProc SkBlitMask::PlatformRowProcs(SkColorType, SkMask::Format, Ro
wFlags) { |
269 return NULL; | 269 return NULL; |
270 } | 270 } |
OLD | NEW |