diff options
author | mtklein <mtklein@chromium.org> | 2016-08-22 13:20:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-22 13:20:18 -0700 |
commit | 8ae991e433d2c0814ea5579613f00173805ff057 (patch) | |
tree | 03948b83317a26c3a1c176c3bfd102a044b0beca /src/effects/gradients | |
parent | 4f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14 (diff) |
Flush denorm half floats to zero.
I think we convinced ourselves that denorms, while a good chunk of half floats,
cover a rather small fraction of the representable range, which is always
close enough to zero to flush.
This makes both paths of the conversion to or from float considerably simpler.
These functions now work for zero-or-normal half floats (excluding infinite, NaN).
I'm not aware of a term for this class so I've called them "ordinary".
A handful of GMs and SKPs draw differently in --config f16, but all imperceptibly.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256023002
Review-Url: https://codereview.chromium.org/2256023002
Diffstat (limited to 'src/effects/gradients')
-rw-r--r-- | src/effects/gradients/Sk4fGradientPriv.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/effects/gradients/Sk4fGradientPriv.h b/src/effects/gradients/Sk4fGradientPriv.h index 6542683eb0..65fa821e85 100644 --- a/src/effects/gradients/Sk4fGradientPriv.h +++ b/src/effects/gradients/Sk4fGradientPriv.h @@ -141,12 +141,12 @@ struct DstTraits<DstType::F16, premul> { } static void store(const Sk4f& c, Type* dst) { - SkFloatToHalf_finite(PM::apply(c)).store(dst); + SkFloatToHalf_finite_ftz(PM::apply(c)).store(dst); } static void store(const Sk4f& c, Type* dst, int n) { uint64_t color; - SkFloatToHalf_finite(PM::apply(c)).store(&color); + SkFloatToHalf_finite_ftz(PM::apply(c)).store(&color); sk_memset64(dst, color, n); } |