SkColorSpaceXform bug fixes

(1) Clamp properly!

Finally came to this realization: clamping in the
store functions (after gamma encoding) is ridiculous.
It is impossible to know how to clamp premul values
to alpha when they are already gamma encoded.

I've moved the clamp out of the store function.
Whew, this actually makes the code look simpler.

And I expect this to fix some buggy images on Gold!

(2) Correctly handle the memcpy() case.

Looks like this only ever worked for RGBA inputs,
never got updated when we added BGRA inputs.

This probably flew under the radar because the
clients are smart enough to avoid performing a
color xform altogether when the color spaces
match.

BUG=skia:

Change-Id: I4870048105efcbecc70b4bd5f77c39537006363e
Reviewed-on: https://skia-review.googlesource.com/5389
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2 files changed