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 "SkCpu.h" | 8 #include "SkCpu.h" |
9 #include "SkHalf.h" | 9 #include "SkHalf.h" |
10 #include "SkOnce.h" | 10 #include "SkOnce.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 decltype(half_to_float) half_to_float = sk_default::half_to_float; | 75 decltype(half_to_float) half_to_float = sk_default::half_to_float; |
76 decltype(float_to_half) float_to_half = sk_default::float_to_half; | 76 decltype(float_to_half) float_to_half = sk_default::float_to_half; |
77 | 77 |
78 decltype(srcover_srgb_srgb) srcover_srgb_srgb = sk_default::srcover_srgb_srg
b; | 78 decltype(srcover_srgb_srgb) srcover_srgb_srgb = sk_default::srcover_srgb_srg
b; |
79 | 79 |
80 decltype(color_xform_RGB1_srgb_to_2dot2) color_xform_RGB1_srgb_to_2dot2 = | 80 decltype(color_xform_RGB1_srgb_to_2dot2) color_xform_RGB1_srgb_to_2dot2 = |
81 sk_default::color_xform_RGB1_srgb_to_2dot2; | 81 sk_default::color_xform_RGB1_srgb_to_2dot2; |
82 decltype(color_xform_RGB1_2dot2_to_2dot2) color_xform_RGB1_2dot2_to_2dot2 = | 82 decltype(color_xform_RGB1_2dot2_to_2dot2) color_xform_RGB1_2dot2_to_2dot2 = |
83 sk_default::color_xform_RGB1_2dot2_to_2dot2; | 83 sk_default::color_xform_RGB1_2dot2_to_2dot2; |
| 84 decltype(color_xform_RGB1_srgb_to_srgb) color_xform_RGB1_srgb_to_srgb = |
| 85 sk_default::color_xform_RGB1_srgb_to_srgb; |
| 86 decltype(color_xform_RGB1_2dot2_to_srgb) color_xform_RGB1_2dot2_to_srgb = |
| 87 sk_default::color_xform_RGB1_2dot2_to_srgb; |
84 | 88 |
85 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. | 89 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. |
86 void Init_ssse3(); | 90 void Init_ssse3(); |
87 void Init_sse41(); | 91 void Init_sse41(); |
88 void Init_sse42() {} | 92 void Init_sse42() {} |
89 void Init_avx() {} | 93 void Init_avx() {} |
90 void Init_avx2() {} | 94 void Init_avx2() {} |
91 | 95 |
92 static void init() { | 96 static void init() { |
93 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) | 97 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) |
94 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } | 98 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } |
95 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } | 99 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } |
96 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } | 100 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } |
97 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } | 101 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } |
98 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } | 102 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } |
99 #endif | 103 #endif |
100 } | 104 } |
101 | 105 |
102 void Init() { | 106 void Init() { |
103 static SkOnce once; | 107 static SkOnce once; |
104 once(init); | 108 once(init); |
105 } | 109 } |
106 } // namespace SkOpts | 110 } // namespace SkOpts |
OLD | NEW |