Fix webp bug compositing alpha frames on opaque (better fix)

The old code made the wrong assumptions about premultiplication.

There are three relevant steps here for decoding a webp frame:
1 tell libwebp to decode
2 colorXform the result (sometimes)
3 blend with the prior frame (sometimes)

Rearrange the code to premultiply at the blend step, in a linear space.
If the client wants unpremul, the blend step will unpremul after.

If there is no blending, the colorXform (if any) will premultiply.

If only step 1 is necessary, let libwebp premultiply.

This fixes an animated image that has an opaque frame 0 followed by a
frame with alpha that blends with it.

Add the test image that failed (https://mathiasbynens.be/demo/animated-webp)

The prior fix is in 42bae8faa4b9b6a3341b15c6ac7c6b466e95625c. It did
not properly handle the colorXform when there was no blending step.

Change-Id: I2b9d265ba162eaf7e55a106c8f79341826cee0d3
Reviewed-on: https://skia-review.googlesource.com/72281
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
3 files changed