| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 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 "SkOnce.h" | 8 #include "SkOnce.h" |
| 9 #include "SkOpts.h" | 9 #include "SkOpts.h" |
| 10 | 10 |
| 11 #define SK_OPTS_NS sk_default | 11 #define SK_OPTS_NS sk_default |
| 12 #include "SkBlitMask_opts.h" | 12 #include "SkBlitMask_opts.h" |
| 13 #include "SkBlitRow_opts.h" | 13 #include "SkBlitRow_opts.h" |
| 14 #include "SkBlurImageFilter_opts.h" | 14 #include "SkBlurImageFilter_opts.h" |
| 15 #include "SkColorCubeFilter_opts.h" | 15 #include "SkColorCubeFilter_opts.h" |
| 16 #include "SkFloatingPoint_opts.h" | 16 #include "SkFloatingPoint_opts.h" |
| 17 #include "SkMatrix_opts.h" | 17 #include "SkMatrix_opts.h" |
| 18 #include "SkMorphologyImageFilter_opts.h" | 18 #include "SkMorphologyImageFilter_opts.h" |
| 19 #include "SkTextureCompressor_opts.h" | 19 #include "SkTextureCompressor_opts.h" |
| 20 #include "SkUtils_opts.h" | 20 #include "SkUtils_opts.h" |
| 21 #include "SkXfermode_opts.h" | 21 #include "SkXfermode_opts.h" |
| 22 | 22 |
| 23 #if defined(SK_CPU_X86) | 23 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) |
| 24 #if defined(SK_BUILD_FOR_WIN32) | 24 #if defined(SK_BUILD_FOR_WIN32) |
| 25 #include <intrin.h> | 25 #include <intrin.h> |
| 26 static void cpuid (uint32_t abcd[4]) { __cpuid ((int*)abcd, 1); } | 26 static void cpuid (uint32_t abcd[4]) { __cpuid ((int*)abcd, 1); } |
| 27 static void cpuid7(uint32_t abcd[4]) { __cpuidex((int*)abcd, 7, 0); } | 27 static void cpuid7(uint32_t abcd[4]) { __cpuidex((int*)abcd, 7, 0); } |
| 28 static uint64_t xgetbv(uint32_t xcr) { return _xgetbv(xcr); } | 28 static uint64_t xgetbv(uint32_t xcr) { return _xgetbv(xcr); } |
| 29 #else | 29 #else |
| 30 #include <cpuid.h> | 30 #include <cpuid.h> |
| 31 #if !defined(__cpuid_count) // Old Mac Clang doesn't have this defined. | 31 #if !defined(__cpuid_count) // Old Mac Clang doesn't have this defined. |
| 32 #define __cpuid_count(eax, ecx, a, b, c, d) \ | 32 #define __cpuid_count(eax, ecx, a, b, c, d) \ |
| 33 __asm__("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(eax),
"2"(ecx)) | 33 __asm__("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(eax),
"2"(ecx)) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 SK_DECLARE_STATIC_ONCE(gInitOnce); | 119 SK_DECLARE_STATIC_ONCE(gInitOnce); |
| 120 void Init() { SkOnce(&gInitOnce, init); } | 120 void Init() { SkOnce(&gInitOnce, init); } |
| 121 | 121 |
| 122 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 122 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
| 123 static struct AutoInit { | 123 static struct AutoInit { |
| 124 AutoInit() { Init(); } | 124 AutoInit() { Init(); } |
| 125 } gAutoInit; | 125 } gAutoInit; |
| 126 #endif | 126 #endif |
| 127 } | 127 } |
| OLD | NEW |