[graphite] Consolidate PreAlpha+PostAlpha shader logic
Previously ColorSpaceTransformPremul (unlike the more complex CS
transform snippets) was able to merge the unpremul branch and the
force-opaque/premul/no-op into a single if-else statement.
With PreAlpha+PostAlpha, there was one if-else for unpremul and
force-opaque and a separate always-on expression to handle premul
and no-op. This seemed to have a negative impact on performance for
some devices: https://skia-perf.luci.app/t/?begin=1781887113&end=1781887114&subset=all
This rewrites the logic so that PreAlpha can also support a premul
operation, and in the case where the whole colorspace conversion
would have been PreAlpha+PostAlpha, it can just be PreAlpha instead.
While this adds a couple of instructions to PreAlpha, it's hopefully
negligible. We'll see.
Bug: 509897459
Change-Id: Ib5bafb13d4db27d135b16d8dfbd851d7a2e8c086
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1279896
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
7 files changed