Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: src/core/SkOpts.cpp

Issue 2194303002: Refactor of SkColorSpaceXformOpts (Closed) Base URL: https://skia.googlesource.com/skia.git@pngapis
Patch Set: Fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkOpts.h ('k') | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "SkOpts.h" 11 #include "SkOpts.h"
12 12
13 #if defined(SK_ARM_HAS_NEON) 13 #if defined(SK_ARM_HAS_NEON)
14 #define SK_OPTS_NS neon 14 #define SK_OPTS_NS neon
15 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 15 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3
16 #define SK_OPTS_NS ssse3 16 #define SK_OPTS_NS ssse3
17 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE3 17 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE3
18 #define SK_OPTS_NS sse3 18 #define SK_OPTS_NS sse3
19 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 19 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
20 #define SK_OPTS_NS sse2 20 #define SK_OPTS_NS sse2
21 #else 21 #else
22 #define SK_OPTS_NS portable 22 #define SK_OPTS_NS portable
23 #endif 23 #endif
24 24
25 #include "SkBlend_opts.h" 25 #include "SkBlend_opts.h"
26 #include "SkBlitMask_opts.h" 26 #include "SkBlitMask_opts.h"
27 #include "SkBlitRow_opts.h" 27 #include "SkBlitRow_opts.h"
28 #include "SkBlurImageFilter_opts.h" 28 #include "SkBlurImageFilter_opts.h"
29 #include "SkColorCubeFilter_opts.h" 29 #include "SkColorCubeFilter_opts.h"
30 #include "SkColorXform_opts.h"
31 #include "SkMorphologyImageFilter_opts.h" 30 #include "SkMorphologyImageFilter_opts.h"
32 #include "SkSwizzler_opts.h" 31 #include "SkSwizzler_opts.h"
33 #include "SkTextureCompressor_opts.h" 32 #include "SkTextureCompressor_opts.h"
34 #include "SkXfermode_opts.h" 33 #include "SkXfermode_opts.h"
35 34
36 namespace SkOpts { 35 namespace SkOpts {
37 // Define default function pointer values here... 36 // Define default function pointer values here...
38 // If our global compile options are set high enough, these defaults might e ven be 37 // If our global compile options are set high enough, these defaults might e ven be
39 // CPU-specialized, e.g. a typical x86-64 machine might start with SSE2 defa ults. 38 // CPU-specialized, e.g. a typical x86-64 machine might start with SSE2 defa ults.
40 // They'll still get a chance to be replaced with even better ones, e.g. usi ng SSE4.1. 39 // They'll still get a chance to be replaced with even better ones, e.g. usi ng SSE4.1.
(...skipping 23 matching lines...) Expand all
64 DEFINE_DEFAULT(RGBA_to_bgrA); 63 DEFINE_DEFAULT(RGBA_to_bgrA);
65 DEFINE_DEFAULT(RGB_to_RGB1); 64 DEFINE_DEFAULT(RGB_to_RGB1);
66 DEFINE_DEFAULT(RGB_to_BGR1); 65 DEFINE_DEFAULT(RGB_to_BGR1);
67 DEFINE_DEFAULT(gray_to_RGB1); 66 DEFINE_DEFAULT(gray_to_RGB1);
68 DEFINE_DEFAULT(grayA_to_RGBA); 67 DEFINE_DEFAULT(grayA_to_RGBA);
69 DEFINE_DEFAULT(grayA_to_rgbA); 68 DEFINE_DEFAULT(grayA_to_rgbA);
70 DEFINE_DEFAULT(inverted_CMYK_to_RGB1); 69 DEFINE_DEFAULT(inverted_CMYK_to_RGB1);
71 DEFINE_DEFAULT(inverted_CMYK_to_BGR1); 70 DEFINE_DEFAULT(inverted_CMYK_to_BGR1);
72 71
73 DEFINE_DEFAULT(srcover_srgb_srgb); 72 DEFINE_DEFAULT(srcover_srgb_srgb);
74
75 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2);
76 DEFINE_DEFAULT(color_xform_RGB1_to_srgb);
77 DEFINE_DEFAULT(color_xform_RGB1_to_table);
78 DEFINE_DEFAULT(color_xform_RGB1_to_linear);
79 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2_swaprb);
80 DEFINE_DEFAULT(color_xform_RGB1_to_srgb_swaprb);
81 DEFINE_DEFAULT(color_xform_RGB1_to_table_swaprb);
82 #undef DEFINE_DEFAULT 73 #undef DEFINE_DEFAULT
83 74
84 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. 75 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
85 void Init_ssse3(); 76 void Init_ssse3();
86 void Init_sse41(); 77 void Init_sse41();
87 void Init_sse42() {} 78 void Init_sse42() {}
88 void Init_avx(); 79 void Init_avx();
89 void Init_avx2() {} 80 void Init_avx2() {}
90 81
91 static void init() { 82 static void init() {
92 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) 83 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS)
93 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } 84 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); }
94 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } 85 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); }
95 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } 86 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); }
96 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } 87 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); }
97 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } 88 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); }
98 #endif 89 #endif
99 } 90 }
100 91
101 void Init() { 92 void Init() {
102 static SkOnce once; 93 static SkOnce once;
103 once(init); 94 once(init);
104 } 95 }
105 } // namespace SkOpts 96 } // namespace SkOpts
OLDNEW
« no previous file with comments | « src/core/SkOpts.h ('k') | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698