clamp to [0,1] before blending with normalized
GL clamps to the limits of the destination format before blending,
so for consistency I think we ought to also.
I believe it's sufficient to add just this one new clamp for alpha to
[0,1] before the other clamps, only when is-premul && is-normalized:
- our GPU backend only draws premul, so there's nothing
to be inconsistent with when drawing into unpremul;
- since we're already clamping rgb to alpha in these cases,
clamping alpha first to [0,1] clamps rgb to [0,1] also.
Change-Id: If77bb4ea8614e6ed100d37f27427d9b2fe12374f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263098
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
3 files changed