aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts/Sk4px_SSE2.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-05-15 10:36:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-15 10:36:21 -0700
commit0135a41e095a433414e21e37b277dab7dcbec373 (patch)
treeee4bb27e2777f7978990a0a08b5db9641cdd34b6 /src/opts/Sk4px_SSE2.h
parentfa33f5a6b770130acdc55f2ffe19dd545665726a (diff)
Sk4px: Difference and Exclusion
This will cause minor (off-by-one) diffs due to a little lost precision: colortype_xfermodes mixed_xfermodes xfermodes2 xfermodeimagefilter xfermodes3 xfermodes Desktop: Xfermode_Difference_aa 9.77ms -> 7.32ms 0.75x Xfermode_Exclusion_aa 8.49ms -> 6.21ms 0.73x Xfermode_Difference 17ms -> 7.54ms 0.44x Xfermode_Exclusion 13.5ms -> 5.09ms 0.38x N7: Xfermode_Difference_aa 32.2ms -> 27.6ms 0.86x Xfermode_Difference 43.9ms -> 32ms 0.73x Xfermode_Exclusion_aa 40.5ms -> 26.7ms 0.66x Xfermode_Exclusion 71.5ms -> 23.9ms 0.33x This wraps up the xfermodes implemented in Sk4f. BUG=skia: Review URL: https://codereview.chromium.org/1141213002
Diffstat (limited to 'src/opts/Sk4px_SSE2.h')
-rw-r--r--src/opts/Sk4px_SSE2.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/opts/Sk4px_SSE2.h b/src/opts/Sk4px_SSE2.h
index 55e1a69135..9ba510347e 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));
+}