more sophisticated opacity in SkImageShader
more sophisticated opacity in SkImageShader

The tricky bit here is tracking when we care if the image is opaque,
and when we care if the shader output is opaque. These are usually
the same, except for decal tiling modes.

We can exploit both of these properties:
   - if the shader output is opaque, set alpha to 1.0f after all
     sampling and interpolation to retroactively skip any the unpacking
     and interpolation we did to calculate alpha.
   - if the input is opaque, set alpha to 1.0f after each sample to skip
     unpacking it.  This mostly just helps decal modes, as this will
     itself all be skipped when the output is opaque.

Change-Id: Ie2954e59f0f9da8be7ad5d11f30fdfd4635c4b70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270656
Commit-Queue: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@google.com>
Reviewed-by: Mike Reed <f5cabf8735907151a446812c9875d6c0c712d847@google.com>

google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia