float xfermodes (burn, dodge, softlight) in Sk8f, possibly using AVX.
authormtklein <mtklein@chromium.org>
Wed, 11 Nov 2015 19:39:09 +0000 (11:39 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 11 Nov 2015 19:39:09 +0000 (11:39 -0800)
commit084db25d47dbad3ffbd7d15c04b63d344b351f90
tree1152701d1608211322670f1246c7228978d8e32e
parent9be5ff6f9871ef22740094e7c25dd67329a73d20
float xfermodes (burn, dodge, softlight) in Sk8f, possibly using AVX.

Xfermode_ColorDodge_aa 10.3ms -> 7.85ms 0.76x
 Xfermode_SoftLight_aa 13.8ms -> 10.2ms 0.74x
 Xfermode_ColorBurn_aa 10.7ms -> 7.82ms 0.73x
    Xfermode_SoftLight 33.6ms -> 23.2ms 0.69x
   Xfermode_ColorDodge   25ms -> 16.5ms 0.66x
    Xfermode_ColorBurn 26.1ms -> 16.6ms 0.63x

Ought to be no pixel diffs:
https://gold.skia.org/search2?issue=1432903002&unt=true&query=source_type%3Dgm&master=false

Incidental stuff:

I made the SkNx(T) constructors implicit to make writing math expressions simpler.
This allows us to write expressions like
  Sk4f v;
  ...
  v = v*4;
rather than
  Sk4f v;
  ...
  v = v * Sk4f(4);

As written it only works when the constant is on the right-hand side,
so expressions like `(Sk4f(1) - da)` have to stay for now.  I plan on
following up with a CL that lets those become `(1 - da)` too.

BUG=skia:4117
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review URL: https://codereview.chromium.org/1432903002
gyp/opts.gypi
src/core/SkNx.h
src/core/SkOpts.cpp
src/opts/SkNx_avx.h [new file with mode: 0644]
src/opts/SkNx_neon.h
src/opts/SkNx_sse.h
src/opts/SkOpts_avx.cpp [new file with mode: 0644]
src/opts/SkXfermode_opts.h