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 portable | 11 #define SK_OPTS_NS portable |
12 #include "SkBlitMask_opts.h" | 12 #include "SkBlitMask_opts.h" |
13 #include "SkBlurImageFilter_opts.h" | 13 #include "SkBlurImageFilter_opts.h" |
| 14 #include "SkColorCubeFilter_opts.h" |
14 #include "SkFloatingPoint_opts.h" | 15 #include "SkFloatingPoint_opts.h" |
15 #include "SkMorphologyImageFilter_opts.h" | 16 #include "SkMorphologyImageFilter_opts.h" |
16 #include "SkTextureCompressor_opts.h" | 17 #include "SkTextureCompressor_opts.h" |
17 #include "SkUtils_opts.h" | 18 #include "SkUtils_opts.h" |
18 #include "SkXfermode_opts.h" | 19 #include "SkXfermode_opts.h" |
19 | 20 |
20 #if defined(SK_CPU_X86) | 21 #if defined(SK_CPU_X86) |
21 #if defined(SK_BUILD_FOR_WIN32) | 22 #if defined(SK_BUILD_FOR_WIN32) |
22 #include <intrin.h> | 23 #include <intrin.h> |
23 static void cpuid(uint32_t abcd[4]) { __cpuid((int*)abcd, 1); } | 24 static void cpuid(uint32_t abcd[4]) { __cpuid((int*)abcd, 1); } |
24 #else | 25 #else |
25 #include <cpuid.h> | 26 #include <cpuid.h> |
26 static void cpuid(uint32_t abcd[4]) { __get_cpuid(1, abcd+0, abcd+1, abc
d+2, abcd+3); } | 27 static void cpuid(uint32_t abcd[4]) { __get_cpuid(1, abcd+0, abcd+1, abc
d+2, abcd+3); } |
27 #endif | 28 #endif |
28 #elif !defined(SK_ARM_HAS_NEON) && defined(SK_CPU_ARM32) && defined(SK_BUILD_FOR
_ANDROID) | 29 #elif !defined(SK_ARM_HAS_NEON) && defined(SK_CPU_ARM32) && defined(SK_BUILD_FOR
_ANDROID) |
29 #include <cpu-features.h> | 30 #include <cpu-features.h> |
30 #endif | 31 #endif |
31 | 32 |
32 namespace SkOpts { | 33 namespace SkOpts { |
33 // Define default function pointer values here... | 34 // Define default function pointer values here... |
34 // If our global compile options are set high enough, these 'portable' defau
lts might | 35 // If our global compile options are set high enough, these 'portable' defau
lts might |
35 // even be CPU-specialized, e.g. a typical x86-64 machine might start with S
SE2 defaults. | 36 // even be CPU-specialized, e.g. a typical x86-64 machine might start with S
SE2 defaults. |
36 // They'll still get a chance to be replaced with even better ones, e.g. usi
ng SSE4.1. | 37 // They'll still get a chance to be replaced with even better ones, e.g. usi
ng SSE4.1. |
37 decltype(rsqrt) rsqrt = portable::rsqrt; | 38 decltype(rsqrt) rsqrt = portable::rsqrt; |
38 decltype(memset16) memset16 = portable::memset16; | 39 decltype(memset16) memset16 = portable::memset16; |
39 decltype(memset32) memset32 = portable::memset32; | 40 decltype(memset32) memset32 = portable::memset32; |
40 decltype(create_xfermode) create_xfermode = SkCreate4pxXfermode; | 41 decltype(create_xfermode) create_xfermode = SkCreate4pxXfermode; |
| 42 decltype(color_cube_filter_span) color_cube_filter_span = portable::color_cu
be_filter_span; |
41 | 43 |
42 decltype(box_blur_xx) box_blur_xx = portable::box_blur_xx; | 44 decltype(box_blur_xx) box_blur_xx = portable::box_blur_xx; |
43 decltype(box_blur_xy) box_blur_xy = portable::box_blur_xy; | 45 decltype(box_blur_xy) box_blur_xy = portable::box_blur_xy; |
44 decltype(box_blur_yx) box_blur_yx = portable::box_blur_yx; | 46 decltype(box_blur_yx) box_blur_yx = portable::box_blur_yx; |
45 | 47 |
46 decltype(dilate_x) dilate_x = portable::dilate_x; | 48 decltype(dilate_x) dilate_x = portable::dilate_x; |
47 decltype(dilate_y) dilate_y = portable::dilate_y; | 49 decltype(dilate_y) dilate_y = portable::dilate_y; |
48 decltype( erode_x) erode_x = portable::erode_x; | 50 decltype( erode_x) erode_x = portable::erode_x; |
49 decltype( erode_y) erode_y = portable::erode_y; | 51 decltype( erode_y) erode_y = portable::erode_y; |
50 | 52 |
(...skipping 22 matching lines...) Expand all Loading... |
73 | 75 |
74 SK_DECLARE_STATIC_ONCE(gInitOnce); | 76 SK_DECLARE_STATIC_ONCE(gInitOnce); |
75 void Init() { SkOnce(&gInitOnce, init); } | 77 void Init() { SkOnce(&gInitOnce, init); } |
76 | 78 |
77 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 79 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
78 static struct AutoInit { | 80 static struct AutoInit { |
79 AutoInit() { Init(); } | 81 AutoInit() { Init(); } |
80 } gAutoInit; | 82 } gAutoInit; |
81 #endif | 83 #endif |
82 } | 84 } |
OLD | NEW |