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

Unified Diff: src/core/SkNx.h

Issue 2159993003: Improve naive SkColorXform to half floats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments 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
Index: src/core/SkNx.h
diff --git a/src/core/SkNx.h b/src/core/SkNx.h
index dec63f8d898d9d39fb3f5682ddd0dac67933f0c4..2848f052b614ee493e4e98920dad8079009e8856 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -309,6 +309,20 @@ SI Sk4i Sk4f_round(const Sk4f& x) {
(int) lrintf (x[3]), };
}
+// Transpose 4 Sk4h and store (256 bits total).
+SI void Sk4h_store4(void* dst, const Sk4h& r, const Sk4h& g, const Sk4h& b, const Sk4h& a) {
mtklein 2016/07/19 15:37:47 How about auto dst64 = (uint64_t*)dst; Sk4h(r[0],
msarett 2016/07/19 15:47:20 SGTM
+ Sk4h rgba0 = Sk4h(r[0], g[0], b[0], a[0]);
+ Sk4h rgba1 = Sk4h(r[1], g[1], b[1], a[1]);
+ Sk4h rgba2 = Sk4h(r[2], g[2], b[2], a[2]);
+ Sk4h rgba3 = Sk4h(r[3], g[3], b[3], a[3]);
+
+ uint64_t* dst64 = (uint64_t*) dst;
+ rgba0.store(dst64 + 0);
+ rgba1.store(dst64 + 1);
+ rgba2.store(dst64 + 2);
+ rgba3.store(dst64 + 3);
+}
+
#endif
SI void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) {
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | src/core/SkXfermodeF16.cpp » ('j') | src/opts/SkColorXform_opts.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698