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

Unified Diff: src/effects/gradients/Sk4fGradientPriv.h

Issue 2159993003: Improve naive SkColorXform to half floats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Prettier code 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkXfermodeF16.cpp ('k') | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/Sk4fGradientPriv.h
diff --git a/src/effects/gradients/Sk4fGradientPriv.h b/src/effects/gradients/Sk4fGradientPriv.h
index 68e95a63d9ff7dda846dc7eecc3a8c71967f23b1..9745119fd4a23659adc8b60984d3da956dce5b5b 100644
--- a/src/effects/gradients/Sk4fGradientPriv.h
+++ b/src/effects/gradients/Sk4fGradientPriv.h
@@ -143,11 +143,13 @@ struct DstTraits<DstType::F16, premul> {
}
static void store(const Sk4f& c, Type* dst) {
- *dst = SkFloatToHalf_finite(PM::apply(c));
+ SkFloatToHalf_finite(PM::apply(c)).store(dst);
}
static void store(const Sk4f& c, Type* dst, int n) {
- sk_memset64(dst, SkFloatToHalf_finite(PM::apply(c)), n);
+ uint64_t color;
+ SkFloatToHalf_finite(PM::apply(c)).store(&color);
+ sk_memset64(dst, color, n);
}
static void store4x(const Sk4f& c0, const Sk4f& c1,
« no previous file with comments | « src/core/SkXfermodeF16.cpp ('k') | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698