check unpremul scale directly against infinity
There are non-zero values of a that make infinite 1.0f/a. Let's just check for the real thing we care about, that scale is finite. Bug: skia:7123 Change-Id: If97574c9f3f2f0b73c749d0bea9aa19e6114f4d1 Reviewed-on: https://skia-review.googlesource.com/58460 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
587afc9df0
commit
a65f2f001e
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -572,7 +572,8 @@ STAGE(premul_dst, Ctx::None) {
|
||||
db = db * da;
|
||||
}
|
||||
STAGE(unpremul, Ctx::None) {
|
||||
auto scale = if_then_else(a == 0, 0, 1.0f / a);
|
||||
float inf = bit_cast<float>(0x7f800000);
|
||||
auto scale = if_then_else(1.0f/a < inf, 1.0f/a, 0);
|
||||
r *= scale;
|
||||
g *= scale;
|
||||
b *= scale;
|
||||
|
Loading…
Reference in New Issue
Block a user