DescriptionHarden LinearGradient4fContext
Three distinct issues exposed by Fuzzer:
1) truncating the flags to 8 bits may trip the assert in SkToU8
Since clients can pass in any garbage, we cannot assume it fits in 8
bits. Just static_cast<> instead.
2) vertical gradients with dx == -0.0 don't trigger interval inversion.
For dx < 0 we want reversed intervals. But, alas, -0.0 < 0 == false
(thanks, Ob^WIEEE 754!). Use signbit() instead.
3) half closed range checking needs to be inverted for reversed
intervals.
Normally we check for [p0, p1), but for reversed intervals (p1 < p0) we
want to check for [p1, p0), and not (p1, p0]. Adjust the logic
accordingly.
BUG=skia:5647
R=reed@google.com,kjlubick@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2349153004
Committed: https://skia.googlesource.com/skia/+/6d7e4e83035845e87c7972af2e7b635c0a5afbb0
Patch Set 1 #
Messages
Total messages: 11 (7 generated)
|