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 "SkBitmapProcState_opts_SSE2.h" | 8 #include "SkBitmapProcState_opts_SSE2.h" |
9 #include "SkBitmapProcState_opts_SSSE3.h" | 9 #include "SkBitmapProcState_opts_SSSE3.h" |
10 #include "SkBitmapFilter_opts_SSE2.h" | 10 #include "SkBitmapFilter_opts_SSE2.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 getcpuid(1, cpu_info); | 84 getcpuid(1, cpu_info); |
85 return (cpu_info[3] & (1<<26)) != 0; | 85 return (cpu_info[3] & (1<<26)) != 0; |
86 } | 86 } |
87 #endif | 87 #endif |
88 | 88 |
89 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 | 89 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 |
90 /* If we know SSSE3 is supported at compile time, don't even bother checking. */ | 90 /* If we know SSSE3 is supported at compile time, don't even bother checking. */ |
91 static inline bool hasSSSE3() { | 91 static inline bool hasSSSE3() { |
92 return true; | 92 return true; |
93 } | 93 } |
| 94 #elif defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) |
| 95 /* For the Android framework we should always know at compile time if the device |
| 96 * we are building for supports SSSE3. The one exception to this rule is on the |
| 97 * emulator where we are compiled without the -msse3 option (so we have no SSSE3 |
| 98 * procs) but can be run on a host machine that supports SSSE3 instructions. So |
| 99 * for that particular case we disable our SSSE3 options. |
| 100 */ |
| 101 static inline bool hasSSSE3() { |
| 102 return false; |
| 103 } |
94 #else | 104 #else |
95 | 105 |
96 static inline bool hasSSSE3() { | 106 static inline bool hasSSSE3() { |
97 int cpu_info[4] = { 0 }; | 107 int cpu_info[4] = { 0 }; |
98 getcpuid(1, cpu_info); | 108 getcpuid(1, cpu_info); |
99 return (cpu_info[2] & 0x200) != 0; | 109 return (cpu_info[2] & 0x200) != 0; |
100 } | 110 } |
101 #endif | 111 #endif |
102 | 112 |
103 static bool cachedHasSSE2() { | 113 static bool cachedHasSSE2() { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } else { | 341 } else { |
332 return SkPlatformXfermodeFactory_impl(rec, mode); | 342 return SkPlatformXfermodeFactory_impl(rec, mode); |
333 } | 343 } |
334 } | 344 } |
335 | 345 |
336 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); | 346 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode); |
337 | 347 |
338 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { | 348 SkXfermodeProc SkPlatformXfermodeProcFactory(SkXfermode::Mode mode) { |
339 return NULL; | 349 return NULL; |
340 } | 350 } |
OLD | NEW |