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

Unified Diff: src/opts/Sk4px_NEON.h

Issue 1141213002: Sk4px: Difference and Exclusion (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: back to 8-bit 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/core/SkXfermode.cpp ('k') | src/opts/Sk4px_SSE2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/Sk4px_NEON.h
diff --git a/src/opts/Sk4px_NEON.h b/src/opts/Sk4px_NEON.h
index 368551949cbc466b023c76ad57e989c53893c92a..f0d9b56c71194f3ec0050eeb0fdb793e5064d549 100644
--- a/src/opts/Sk4px_NEON.h
+++ b/src/opts/Sk4px_NEON.h
@@ -78,3 +78,13 @@ inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) {
a32 = vorrq_u32(a32, vshlq_n_u32(a32, 16)); // ____ ____ 1111 0000
return Sk16b((uint8x16_t)a32);
}
+
+inline Sk4px Sk4px::zeroColors() const {
+ return Sk16b(vandq_u8(this->fVec, (uint8x16_t)vdupq_n_u32(0xFF << SK_A32_SHIFT)));
+}
+
+inline Sk4px Sk4px::zeroAlphas() const {
+ // vbic(a,b) == a & ~b
+ return Sk16b(vbicq_u8(this->fVec, (uint8x16_t)vdupq_n_u32(0xFF << SK_A32_SHIFT)));
+}
+
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/opts/Sk4px_SSE2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698