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

Side by Side Diff: src/effects/gradients/Sk4fGradientPriv.h

Issue 2145663003: Expand _01 half<->float limitation to _finite. Simplify. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: drop _mm_packus_epi32 for now. 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/SkXfermodeF16.cpp ('k') | src/opts/SkNx_neon.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 2016 Google Inc. 2 * Copyright 2016 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 #ifndef Sk4fGradientPriv_DEFINED 8 #ifndef Sk4fGradientPriv_DEFINED
9 #define Sk4fGradientPriv_DEFINED 9 #define Sk4fGradientPriv_DEFINED
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 template <ApplyPremul premul> 136 template <ApplyPremul premul>
137 struct DstTraits<DstType::F16, premul> { 137 struct DstTraits<DstType::F16, premul> {
138 using PM = PremulTraits<premul>; 138 using PM = PremulTraits<premul>;
139 using Type = uint64_t; 139 using Type = uint64_t;
140 140
141 static Sk4f load(const SkPM4f& c) { 141 static Sk4f load(const SkPM4f& c) {
142 return c.to4f(); 142 return c.to4f();
143 } 143 }
144 144
145 static void store(const Sk4f& c, Type* dst) { 145 static void store(const Sk4f& c, Type* dst) {
146 *dst = SkFloatToHalf_01(PM::apply(c)); 146 *dst = SkFloatToHalf_finite(PM::apply(c));
147 } 147 }
148 148
149 static void store(const Sk4f& c, Type* dst, int n) { 149 static void store(const Sk4f& c, Type* dst, int n) {
150 sk_memset64(dst, SkFloatToHalf_01(PM::apply(c)), n); 150 sk_memset64(dst, SkFloatToHalf_finite(PM::apply(c)), n);
151 } 151 }
152 152
153 static void store4x(const Sk4f& c0, const Sk4f& c1, 153 static void store4x(const Sk4f& c0, const Sk4f& c1,
154 const Sk4f& c2, const Sk4f& c3, 154 const Sk4f& c2, const Sk4f& c3,
155 Type* dst) { 155 Type* dst) {
156 store(c0, dst + 0); 156 store(c0, dst + 0);
157 store(c1, dst + 1); 157 store(c1, dst + 1);
158 store(c2, dst + 2); 158 store(c2, dst + 2);
159 store(c3, dst + 3); 159 store(c3, dst + 3);
160 } 160 }
(...skipping 25 matching lines...) Expand all
186 store(c0, dst + 0); 186 store(c0, dst + 0);
187 store(c1, dst + 1); 187 store(c1, dst + 1);
188 store(c2, dst + 2); 188 store(c2, dst + 2);
189 store(c3, dst + 3); 189 store(c3, dst + 3);
190 } 190 }
191 }; 191 };
192 192
193 } // anonymous namespace 193 } // anonymous namespace
194 194
195 #endif // Sk4fGradientPriv_DEFINED 195 #endif // Sk4fGradientPriv_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkXfermodeF16.cpp ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698