diff options
author | 2015-05-15 10:36:21 -0700 | |
---|---|---|
committer | 2015-05-15 10:36:21 -0700 | |
commit | 0135a41e095a433414e21e37b277dab7dcbec373 (patch) | |
tree | ee4bb27e2777f7978990a0a08b5db9641cdd34b6 /src/opts/Sk4px_none.h | |
parent | fa33f5a6b770130acdc55f2ffe19dd545665726a (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_none.h')
-rw-r--r-- | src/opts/Sk4px_none.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/opts/Sk4px_none.h b/src/opts/Sk4px_none.h index 340a36fd14..541443d772 100644 --- a/src/opts/Sk4px_none.h +++ b/src/opts/Sk4px_none.h @@ -77,3 +77,20 @@ inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) { 0,0,0,0, 0,0,0,0); } + +inline Sk4px Sk4px::zeroAlphas() const { + static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); + return Sk16b(this->kth< 0>(), this->kth< 1>(), this->kth< 2>(), 0, + this->kth< 4>(), this->kth< 5>(), this->kth< 6>(), 0, + this->kth< 8>(), this->kth< 9>(), this->kth<10>(), 0, + this->kth<12>(), this->kth<13>(), this->kth<14>(), 0); +} + +inline Sk4px Sk4px::zeroColors() const { + static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); + return Sk16b(0,0,0, this->kth< 3>(), + 0,0,0, this->kth< 7>(), + 0,0,0, this->kth<11>(), + 0,0,0, this->kth<15>()); +} + |