Remove transform_scanline from SkWebpEncoder

Bug: skia:10178

These functions can be performed generically using SkRasterPipeline
or skcms. Further, the reason we used a function pointer anyway was
so that we could call the same function on each row separately. But
libwebp's API doesn't let us do a single row at a time anyway.
Simplify this method by using readPixels when necessary and
skipping conversion entirely when possible.

Add support for encoding from unpremul 4444. It is simpler to support
it, and it's not obvious why we didn't support it before.

Keep the behavior of not supporting A8, and apply the same to the
other alpha-only formats. Note that we could support encoding such an
image to alpha, r=0, g=0, b=0, but I'd rather leave adding that
feature to a separate change, which enables it for all encoders (and
accounts for the internal use of PNGs as a round-trip for
kAlpha_8_SkColorType).

Add GMs to test the newly supported SkColorTypes.

Change-Id: I4d86c5621792fb6dc3cb68b736a1eb35d577e3a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292962
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
4 files changed