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

Unified Diff: src/opts/Sk4px_SSE2.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/opts/Sk4px_NEON.h ('k') | src/opts/Sk4px_none.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/Sk4px_SSE2.h
diff --git a/src/opts/Sk4px_SSE2.h b/src/opts/Sk4px_SSE2.h
index 55e1a69135d561a42d51f5dd2e456d7c1d05564c..9ba510347ec89808f972cd3a97e78406bea478ff 100644
--- a/src/opts/Sk4px_SSE2.h
+++ b/src/opts/Sk4px_SSE2.h
@@ -76,3 +76,12 @@ inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) {
uint32_t as = *(const uint16_t*)a; // Aa -> Aa00
return Load4Alphas((const SkAlpha*)&as);
}
+
+inline Sk4px Sk4px::zeroColors() const {
+ return Sk16b(_mm_and_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fVec));
+}
+
+inline Sk4px Sk4px::zeroAlphas() const {
+ // andnot(a,b) == ~a & b
+ return Sk16b(_mm_andnot_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fVec));
+}
« no previous file with comments | « src/opts/Sk4px_NEON.h ('k') | src/opts/Sk4px_none.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698