clamp before premul

When alpha is <1, it's possible to fit r,g,b >1 into premul unorms,
and that subverts the expectations users who consume the output of
skcms_Transform().

When working with unorm pixels, downstream consumers will assume the
r,g,b values are also within [0,1], i.e. are less than the alpha
channel.  Put another way, they assume the colors are in gamut.

So clamp earlier, before premul.  (The reordering has no effect on
force_opaque or swap_rb.)

Bug: chromium:867813
Bug: chromium:862908
Change-Id: I553b42df06482a4e3cd3a9377c2adddb8ff3d1bc
Reviewed-on: https://skia-review.googlesource.com/143710
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
1 file changed