| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 DEFINE_DEFAULT(srcover_srgb_srgb); | 73 DEFINE_DEFAULT(srcover_srgb_srgb); |
| 74 | 74 |
| 75 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2); | 75 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2); |
| 76 DEFINE_DEFAULT(color_xform_RGB1_to_srgb); | 76 DEFINE_DEFAULT(color_xform_RGB1_to_srgb); |
| 77 DEFINE_DEFAULT(color_xform_RGB1_to_table); | 77 DEFINE_DEFAULT(color_xform_RGB1_to_table); |
| 78 DEFINE_DEFAULT(color_xform_RGB1_to_linear); | 78 DEFINE_DEFAULT(color_xform_RGB1_to_linear); |
| 79 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2_swaprb); | 79 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2_swaprb); |
| 80 DEFINE_DEFAULT(color_xform_RGB1_to_srgb_swaprb); | 80 DEFINE_DEFAULT(color_xform_RGB1_to_srgb_swaprb); |
| 81 DEFINE_DEFAULT(color_xform_RGB1_to_table_swaprb); | 81 DEFINE_DEFAULT(color_xform_RGB1_to_table_swaprb); |
| 82 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2_premul); |
| 83 DEFINE_DEFAULT(color_xform_RGB1_to_srgb_premul); |
| 84 DEFINE_DEFAULT(color_xform_RGB1_to_table_premul); |
| 85 DEFINE_DEFAULT(color_xform_RGB1_to_linear_premul); |
| 86 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2_premul_swaprb); |
| 87 DEFINE_DEFAULT(color_xform_RGB1_to_srgb_premul_swaprb); |
| 88 DEFINE_DEFAULT(color_xform_RGB1_to_table_premul_swaprb); |
| 82 #undef DEFINE_DEFAULT | 89 #undef DEFINE_DEFAULT |
| 83 | 90 |
| 84 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. | 91 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. |
| 85 void Init_ssse3(); | 92 void Init_ssse3(); |
| 86 void Init_sse41(); | 93 void Init_sse41(); |
| 87 void Init_sse42() {} | 94 void Init_sse42() {} |
| 88 void Init_avx(); | 95 void Init_avx(); |
| 89 void Init_avx2() {} | 96 void Init_avx2() {} |
| 90 | 97 |
| 91 static void init() { | 98 static void init() { |
| 92 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) | 99 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) |
| 93 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } | 100 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } |
| 94 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } | 101 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } |
| 95 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } | 102 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } |
| 96 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } | 103 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } |
| 97 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } | 104 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } |
| 98 #endif | 105 #endif |
| 99 } | 106 } |
| 100 | 107 |
| 101 void Init() { | 108 void Init() { |
| 102 static SkOnce once; | 109 static SkOnce once; |
| 103 once(init); | 110 once(init); |
| 104 } | 111 } |
| 105 } // namespace SkOpts | 112 } // namespace SkOpts |
| OLD | NEW |