DescriptionFix buggy blend modes.
The problem turns out to be not over- or underflow like I thought, but that I used different math for x*y/255 for alphas and colors, sometimes resulting in colors where alpha was one less than the maximum color component, which is not a valid SkPMColor.
To be safe, I've switched over all four of these similar complex modes to use exact math everywhere. They now match the byte-by-byte code in SkXfermode.cpp exactly.
This will slow down Darken and Lighten by about 2x. I plan to follow up with a CL to see if I can eek out some speed there, and another CL to add asserts that Sk4px code always writes valid SkPMColors.
BUG=skia:4052
Committed: https://skia.googlesource.com/skia/+/44cf62c79ec06f2d9ba408db593f3da2400d3a43
Patch Set 1 #
Messages
Total messages: 11 (4 generated)
|