[Webkit-unassigned] [Bug 168425] REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 29 12:37:54 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=168425

--- Comment #4 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
Yes, you are right regarding the PNGImageDecoder::repetitionCount(). This function should return RepetitionCountInfinite if the loopCunt is zero. Otherwise it should return the loopCount.

Regarding calculating the premultiplied components, if you look at https://bugs.webkit.org/attachment.cgi?id=288626&action=review you can see the old implementation of the following functions are using different methods for dividing by 255 and they handle the decimal part of the division differently.

premultipliedARGBFromColor()
ImageDecoder::setRGBA()
ImageDecoder::overRGBA()

premultipliedARGBFromColor() was getting the ceiling of the division and this is why there was 254 in the calculations. But ImageDecoder::setRGBA() and ImageDecoder::overRGBA() were just getting the floor of the division.

static_cast<int>((x + 254) / 255.0) will give the ceiling but static_cast<int>(x / 255.0) will get you the floor.

I was just trying to unify the code and remove the duplicates. But it is up to you, you can either change the expected results to match the new calculation. Or you can add an argument to premultipliedChannel(..., bool ceiling = true) and pass it all the way from ImageDecoder to this function.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170329/5c6059ae/attachment.html>


More information about the webkit-unassigned mailing list