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

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

Issue 2152583002: Remove bulk float <-> half routines. These are dead code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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') | tests/Float16Test.cpp » ('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"
(...skipping 15 matching lines...) Expand all
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" 30 #include "SkColorXform_opts.h"
31 #include "SkMorphologyImageFilter_opts.h" 31 #include "SkMorphologyImageFilter_opts.h"
32 #include "SkSwizzler_opts.h" 32 #include "SkSwizzler_opts.h"
33 #include "SkTextureCompressor_opts.h" 33 #include "SkTextureCompressor_opts.h"
34 #include "SkXfermode_opts.h" 34 #include "SkXfermode_opts.h"
35 35
36 namespace SK_OPTS_NS {
37 static void float_to_half(uint16_t dst[], const float src[], int n) {
38 while (n-->0) {
39 *dst++ = SkFloatToHalf(*src++);
40 }
41 }
42 static void half_to_float(float dst[], const uint16_t src[], int n) {
43 while (n-->0) {
44 *dst++ = SkHalfToFloat(*src++);
45 }
46 }
47 }
48
49 namespace SkOpts { 36 namespace SkOpts {
50 // Define default function pointer values here... 37 // Define default function pointer values here...
51 // If our global compile options are set high enough, these defaults might e ven be 38 // If our global compile options are set high enough, these defaults might e ven be
52 // CPU-specialized, e.g. a typical x86-64 machine might start with SSE2 defa ults. 39 // CPU-specialized, e.g. a typical x86-64 machine might start with SSE2 defa ults.
53 // They'll still get a chance to be replaced with even better ones, e.g. usi ng SSE4.1. 40 // They'll still get a chance to be replaced with even better ones, e.g. usi ng SSE4.1.
54 #define DEFINE_DEFAULT(name) decltype(name) name = SK_OPTS_NS::name 41 #define DEFINE_DEFAULT(name) decltype(name) name = SK_OPTS_NS::name
55 DEFINE_DEFAULT(create_xfermode); 42 DEFINE_DEFAULT(create_xfermode);
56 DEFINE_DEFAULT(color_cube_filter_span); 43 DEFINE_DEFAULT(color_cube_filter_span);
57 44
58 DEFINE_DEFAULT(box_blur_xx); 45 DEFINE_DEFAULT(box_blur_xx);
(...skipping 17 matching lines...) Expand all
76 DEFINE_DEFAULT(RGBA_to_rgbA); 63 DEFINE_DEFAULT(RGBA_to_rgbA);
77 DEFINE_DEFAULT(RGBA_to_bgrA); 64 DEFINE_DEFAULT(RGBA_to_bgrA);
78 DEFINE_DEFAULT(RGB_to_RGB1); 65 DEFINE_DEFAULT(RGB_to_RGB1);
79 DEFINE_DEFAULT(RGB_to_BGR1); 66 DEFINE_DEFAULT(RGB_to_BGR1);
80 DEFINE_DEFAULT(gray_to_RGB1); 67 DEFINE_DEFAULT(gray_to_RGB1);
81 DEFINE_DEFAULT(grayA_to_RGBA); 68 DEFINE_DEFAULT(grayA_to_RGBA);
82 DEFINE_DEFAULT(grayA_to_rgbA); 69 DEFINE_DEFAULT(grayA_to_rgbA);
83 DEFINE_DEFAULT(inverted_CMYK_to_RGB1); 70 DEFINE_DEFAULT(inverted_CMYK_to_RGB1);
84 DEFINE_DEFAULT(inverted_CMYK_to_BGR1); 71 DEFINE_DEFAULT(inverted_CMYK_to_BGR1);
85 72
86 DEFINE_DEFAULT(half_to_float);
87 DEFINE_DEFAULT(float_to_half);
88
89 DEFINE_DEFAULT(srcover_srgb_srgb); 73 DEFINE_DEFAULT(srcover_srgb_srgb);
90 74
91 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2); 75 DEFINE_DEFAULT(color_xform_RGB1_to_2dot2);
92 DEFINE_DEFAULT(color_xform_RGB1_to_srgb); 76 DEFINE_DEFAULT(color_xform_RGB1_to_srgb);
93 DEFINE_DEFAULT(color_xform_RGB1_to_table); 77 DEFINE_DEFAULT(color_xform_RGB1_to_table);
94 #undef DEFINE_DEFAULT 78 #undef DEFINE_DEFAULT
95 79
96 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. 80 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
97 void Init_ssse3(); 81 void Init_ssse3();
98 void Init_sse41(); 82 void Init_sse41();
99 void Init_sse42() {} 83 void Init_sse42() {}
100 void Init_avx(); 84 void Init_avx();
101 void Init_avx2() {} 85 void Init_avx2() {}
102 86
103 static void init() { 87 static void init() {
104 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS) 88 #if defined(SK_CPU_X86) && !defined(SK_BUILD_NO_OPTS)
105 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); } 89 if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); }
106 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); } 90 if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); }
107 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); } 91 if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); }
108 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); } 92 if (SkCpu::Supports(SkCpu::AVX )) { Init_avx(); }
109 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); } 93 if (SkCpu::Supports(SkCpu::AVX2 )) { Init_avx2(); }
110 #endif 94 #endif
111 } 95 }
112 96
113 void Init() { 97 void Init() {
114 static SkOnce once; 98 static SkOnce once;
115 once(init); 99 once(init);
116 } 100 }
117 } // namespace SkOpts 101 } // namespace SkOpts
OLDNEW
« no previous file with comments | « src/core/SkOpts.h ('k') | tests/Float16Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698