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

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

Issue 1939783003: Add a hook for CPU-optimized sRGB-sRGB srcover. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 7 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
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 #define SK_OPTS_NS sk_default 13 #define SK_OPTS_NS sk_default
14 #include "SkBlend_opts.h"
14 #include "SkBlitMask_opts.h" 15 #include "SkBlitMask_opts.h"
15 #include "SkBlitRow_opts.h" 16 #include "SkBlitRow_opts.h"
16 #include "SkBlurImageFilter_opts.h" 17 #include "SkBlurImageFilter_opts.h"
17 #include "SkColorCubeFilter_opts.h" 18 #include "SkColorCubeFilter_opts.h"
18 #include "SkMorphologyImageFilter_opts.h" 19 #include "SkMorphologyImageFilter_opts.h"
19 #include "SkSwizzler_opts.h" 20 #include "SkSwizzler_opts.h"
20 #include "SkTextureCompressor_opts.h" 21 #include "SkTextureCompressor_opts.h"
21 #include "SkXfermode_opts.h" 22 #include "SkXfermode_opts.h"
22 23
23 namespace SK_OPTS_NS { 24 namespace SK_OPTS_NS {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 decltype(RGB_to_BGR1) RGB_to_BGR1 = sk_default::RGB_to_B GR1; 67 decltype(RGB_to_BGR1) RGB_to_BGR1 = sk_default::RGB_to_B GR1;
67 decltype(gray_to_RGB1) gray_to_RGB1 = sk_default::gray_to_ RGB1; 68 decltype(gray_to_RGB1) gray_to_RGB1 = sk_default::gray_to_ RGB1;
68 decltype(grayA_to_RGBA) grayA_to_RGBA = sk_default::grayA_to _RGBA; 69 decltype(grayA_to_RGBA) grayA_to_RGBA = sk_default::grayA_to _RGBA;
69 decltype(grayA_to_rgbA) grayA_to_rgbA = sk_default::grayA_to _rgbA; 70 decltype(grayA_to_rgbA) grayA_to_rgbA = sk_default::grayA_to _rgbA;
70 decltype(inverted_CMYK_to_RGB1) inverted_CMYK_to_RGB1 = sk_default::inverted _CMYK_to_RGB1; 71 decltype(inverted_CMYK_to_RGB1) inverted_CMYK_to_RGB1 = sk_default::inverted _CMYK_to_RGB1;
71 decltype(inverted_CMYK_to_BGR1) inverted_CMYK_to_BGR1 = sk_default::inverted _CMYK_to_BGR1; 72 decltype(inverted_CMYK_to_BGR1) inverted_CMYK_to_BGR1 = sk_default::inverted _CMYK_to_BGR1;
72 73
73 decltype(half_to_float) half_to_float = sk_default::half_to_float; 74 decltype(half_to_float) half_to_float = sk_default::half_to_float;
74 decltype(float_to_half) float_to_half = sk_default::float_to_half; 75 decltype(float_to_half) float_to_half = sk_default::float_to_half;
75 76
77 decltype(srcover_srgb_srgb) srcover_srgb_srgb = sk_default::srcover_srgb_srg b;
78
76 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. 79 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
77 void Init_ssse3(); 80 void Init_ssse3();
78 void Init_sse41(); 81 void Init_sse41();
79 void Init_sse42() {} 82 void Init_sse42() {}
80 void Init_avx() {} 83 void Init_avx() {}
81 void Init_avx2() {} 84 void Init_avx2() {}
82 void Init_neon(); 85 void Init_neon();
83 86
84 static void init() { 87 static void init() {
85 // TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug o r feature? 88 // TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug o r feature?
86 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) 89 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS)
87 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } 90 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); }
88 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } 91 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); }
89 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } 92 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); }
90 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } 93 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); }
91 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } 94 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); }
92 95
93 #elif defined(SK_CPU_ARM32) && \ 96 #elif defined(SK_CPU_ARM32) && \
94 defined(SK_BUILD_FOR_ANDROID) && \ 97 defined(SK_BUILD_FOR_ANDROID) && \
95 !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) 98 !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
96 if (SkCpu::Supports(SkCpu::NEON)) { Init_neon(); } 99 if (SkCpu::Supports(SkCpu::NEON)) { Init_neon(); }
97 #endif 100 #endif
98 } 101 }
99 102
100 void Init() { 103 void Init() {
101 static SkOnce once; 104 static SkOnce once;
102 once(init); 105 once(init);
103 } 106 }
104 } // namespace SkOpts 107 } // namespace SkOpts
OLDNEW
« no previous file with comments | « src/core/SkOpts.h ('k') | src/opts/SkBlend_opts.h » ('j') | src/opts/SkBlend_opts.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698