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

Unified Diff: src/core/SkColorSpaceXform.cpp

Issue 2256023002: Flush denorm half floats to zero. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix threshold, clean up tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkHalf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform.cpp
diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp
index 3795d2d8d638229c399aa74d4a1bd60835cfbf60..f4459392674f928e121eaf09a95f5038a448acfa 100644
--- a/src/core/SkColorSpaceXform.cpp
+++ b/src/core/SkColorSpaceXform.cpp
@@ -876,25 +876,25 @@ static inline void store_2dot2_1(void* dst, const uint32_t* src,
static inline void store_f16(void* dst, const uint32_t* src,
Sk4f& dr, Sk4f& dg, Sk4f& db, Sk4f& da,
const uint8_t* const[3], SwapRB) {
- Sk4h_store4(dst, SkFloatToHalf_finite(dr),
- SkFloatToHalf_finite(dg),
- SkFloatToHalf_finite(db),
- SkFloatToHalf_finite(da));
+ Sk4h_store4(dst, SkFloatToHalf_finite_ftz(dr),
+ SkFloatToHalf_finite_ftz(dg),
+ SkFloatToHalf_finite_ftz(db),
+ SkFloatToHalf_finite_ftz(da));
}
static inline void store_f16_1(void* dst, const uint32_t* src,
Sk4f& rgba, const Sk4f& a,
const uint8_t* const[3], SwapRB kSwapRB) {
rgba = Sk4f(rgba[0], rgba[1], rgba[2], a[3]);
- SkFloatToHalf_finite(rgba).store((uint64_t*) dst);
+ SkFloatToHalf_finite_ftz(rgba).store((uint64_t*) dst);
}
static inline void store_f16_opaque(void* dst, const uint32_t* src,
Sk4f& dr, Sk4f& dg, Sk4f& db, Sk4f& da,
const uint8_t* const[3], SwapRB) {
- Sk4h_store4(dst, SkFloatToHalf_finite(dr),
- SkFloatToHalf_finite(dg),
- SkFloatToHalf_finite(db),
+ Sk4h_store4(dst, SkFloatToHalf_finite_ftz(dr),
+ SkFloatToHalf_finite_ftz(dg),
+ SkFloatToHalf_finite_ftz(db),
SK_Half1);
}
@@ -902,7 +902,7 @@ static inline void store_f16_1_opaque(void* dst, const uint32_t* src,
Sk4f& rgba, const Sk4f& a,
const uint8_t* const[3], SwapRB kSwapRB) {
uint64_t tmp;
- SkFloatToHalf_finite(rgba).store(&tmp);
+ SkFloatToHalf_finite_ftz(rgba).store(&tmp);
tmp |= static_cast<uint64_t>(SK_Half1) << 48;
*((uint64_t*) dst) = tmp;
}
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkHalf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698