[graphite] Fix alpha-only handling when CSXform steps need unpremul

If the SkColorSpaceXformSteps required an unpremul/premul action for
regular colorspace work, the values to `unpremul` and `premul`
controls would be set to true for r->alpha swizzles.  They were
correctly being ignored for alpha=1 swizzles (since they are no-ops).

They are also no-ops when the read swizzle is 000r since the RGB
channels are 0s and unpremul/premul does'nt modify the alpha channel
(after applying the swizzle). However, with how the shaders were
written, if `unpremul=true` it was applied as the primary branch
in the shader and then we'd never apply the read swizzle.

Bug: b/510702184
Change-Id: I1e74a7ab5bb05be46c814da6751799defb42795e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1232936
Reviewed-by: Thomas Smith <thomsmit@google.com>
Commit-Queue: Thomas Smith <thomsmit@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
1 file changed