Improve R+G+B op fusing logic.

Previously, we checked for R+G+B ops on every iteration through
the `select_curve_ops` loop because we needed to substitute the
fused RGB op before the A op was added. Now, we process the
channels in reverse order--yielding A/B/G/R instead of R/G/B/A.
With RGB at the end of the list, it is easy to substitute out
a fused op (simply move the cursor back and change the op) at
the end of the loop instead of checking on each loop iteration.

This isn't a big deal but the RGB check inside of the curve-
picking inner loop never felt like a good solution to me.

Change-Id: I978346ceb1b12e116a64af06e909e5adbfd7eedc
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/780816
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1 file changed