History log of /external/skia/src/core/Sk4px.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0135a41e095a433414e21e37b277dab7dcbec373 15-May-2015 mtklein <mtklein@chromium.org> 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
/external/skia/src/core/Sk4px.h
2d8d33e9e825f9919875be64a71b746189b385be 13-May-2015 mtklein <mtklein@chromium.org> Sk4px: SrcATop, DstATop, Xor, Multiply

SSE runs 2-3x faster (than 4f), NEON runs 1.2-1.4x faster (than existing NEON).

Small diffs on {aarectmodes, imagefilters_xfermodes, hairmodes, mixed_xfermodes} only on AA edges due to precision drop.

BUG=skia:

Review URL: https://codereview.chromium.org/1132853005
/external/skia/src/core/Sk4px.h
8a90edc2a58a4f8a4b4da73eb08e943be09538c0 13-May-2015 mtklein <mtklein@chromium.org> Sk4px: alphas() and Load[24]Alphas()

alphas() extracts the 4 alphas from an existing Sk4px as another Sk4px.
LoadNAlphas() constructs an Sk4px from N packed alphas.

In both cases, we end up with 4x repeated alphas aligned with their pixels.

alphas()
A0 R0 G0 B0 A1 R1 G1 B1 A2 R2 G2 B2 A3 R3 G3 B3
->
A0 A0 A0 A0 A1 A1 A1 A1 A2 A2 A2 A2 A3 A3 A3 A3

Load4Alphas()
A0 A1 A2 A3
->
A0 A0 A0 A0 A1 A1 A1 A1 A2 A2 A2 A2 A3 A3 A3 A3

Load2Alphas()
A0 A1
->
A0 A0 A0 A0 A1 A1 A1 A1 0 0 0 0 0 0 0 0

This is a 5-10% speedup for AA on Intel, and wash on ARM.
AA is still mostly dominated by the final lerp.

alphas() isn't used yet, but it's similar enough to Load[24]Alphas()
that it was easier to write all at once.

BUG=skia:

Review URL: https://codereview.chromium.org/1138333003
/external/skia/src/core/Sk4px.h
6cbf18c70bf99f58b2bb1c49cdf8d41be561fee4 13-May-2015 mtklein <mtklein@chromium.org> Plus xfermode using Sk4px.

Xfermode_Plus runs 4-5x faster.

We expect mixed_xfermodes to have a small diff. This is because kFoldCoverageIntoSrcAlpha was incorrectly set to true.

This implementation handily beats the Sk4f impl, the portable impl, and the existing SSE2 impl. Reading the SkXfermodes_opts_SSE2.cpp file, I'm pretty confident that we'll be able to beat all SSE2 impls.

I believe this impl will beat or match the existing NEON impl too, but that may not be true for more complicated xfermodes. They can take advantage of transposing ARGBARGB... to AAAARRRR.... cheaply and I haven't figured out an abstraction for that yet that doesn't screw SSE.

Adds:
- MapDstSrc() to Sk4px
- saturatedAdd() to SkNi (only implemented as far as it's used).
- div255Narrow()

BUG=skia:

Review URL: https://codereview.chromium.org/1138893002
/external/skia/src/core/Sk4px.h
d2ffd36eb62e99abe2920369d1e040954cc2044f 12-May-2015 mtklein <mtklein@chromium.org> Sk4px

Xfermode_SrcOver:
SSE: 2.08ms -> 2.03ms (~2% faster)
NEON: my N5 is noisy, but there appears to be no perf change

BUG=skia:

Review URL: https://codereview.chromium.org/1132273004
/external/skia/src/core/Sk4px.h