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

Unified Diff: src/opts/Sk4px_none.h

Issue 1138333003: Sk4px: alphas() and Load[24]Alphas() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: neon too Created 5 years, 7 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/opts/Sk4px_SSE2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/Sk4px_none.h
diff --git a/src/opts/Sk4px_none.h b/src/opts/Sk4px_none.h
index c8c33a0d16fa1ef779230b481d7fdb76cc4d6950..340a36fd1478014141032faa24921dc82824aafe 100644
--- a/src/opts/Sk4px_none.h
+++ b/src/opts/Sk4px_none.h
@@ -55,3 +55,25 @@ inline Sk4px Sk4px::Wide::addNarrowHi(const Sk16h& other) const {
r.kth< 8>(), r.kth< 9>(), r.kth<10>(), r.kth<11>(),
r.kth<12>(), r.kth<13>(), r.kth<14>(), r.kth<15>());
}
+
+inline Sk4px Sk4px::alphas() const {
+ static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
+ return Sk16b(this->kth< 3>(), this->kth< 3>(), this->kth< 3>(), this->kth< 3>(),
+ this->kth< 7>(), this->kth< 7>(), this->kth< 7>(), this->kth< 7>(),
+ this->kth<11>(), this->kth<11>(), this->kth<11>(), this->kth<11>(),
+ this->kth<15>(), this->kth<15>(), this->kth<15>(), this->kth<15>());
+}
+
+inline Sk4px Sk4px::Load4Alphas(const SkAlpha a[4]) {
+ return Sk16b(a[0], a[0], a[0], a[0],
+ a[1], a[1], a[1], a[1],
+ a[2], a[2], a[2], a[2],
+ a[3], a[3], a[3], a[3]);
+}
+
+inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) {
+ return Sk16b(a[0], a[0], a[0], a[0],
+ a[1], a[1], a[1], a[1],
+ 0,0,0,0,
+ 0,0,0,0);
+}
« no previous file with comments | « src/opts/Sk4px_SSE2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698