move clamp until just before store

By moving this clamp until just before the store,
we're minimizing the chance we'd do something between
the clamp and store that undoes the clamp's guarantee,
e.g. unpremul().

It also means we can now try thinking of ways to do
the clamp and store simultaneously in an integrated
way if that makes things faster or more safe somehow.
E.g. to_unorm() could do the clamp itself.

Change-Id: If07d09b4b59a8a20b236b4954ca79c660d6be85b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270614
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
1 file changed