RESOLVED FIXED 49330
[chromium] Canvas getImageData/putImageData cycle should not change values for valid premultiplied colours.
https://bugs.webkit.org/show_bug.cgi?id=49330
Summary [chromium] Canvas getImageData/putImageData cycle should not change values fo...
Stephen White
Reported 2010-11-10 11:12:24 PST
[chromium] Canvas getImageData/putImageData cycle should not change values for valid premultiplied colours.
Attachments
Patch (4.22 KB, patch)
2010-11-10 11:17 PST, Stephen White
jamesr: review+
Stephen White
Comment 1 2010-11-10 11:17:23 PST
James Robinson
Comment 2 2010-11-10 11:44:25 PST
Comment on attachment 73516 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=73516&action=review R=me, please consider comment. > WebCore/platform/graphics/skia/ImageBufferSkia.cpp:241 > +// This function does the equivalent of (a * b + 254) / 255, without an integer divide. Is there any reason to avoid an integer divide? I think it'd be a lot easier to read that way and the compiler can figure out the best code to generate for a given platform.
Stephen White
Comment 3 2010-11-10 11:52:08 PST
(In reply to comment #2) > (From update of attachment 73516 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=73516&action=review > > R=me, please consider comment. > > > WebCore/platform/graphics/skia/ImageBufferSkia.cpp:241 > > +// This function does the equivalent of (a * b + 254) / 255, without an integer divide. > > Is there any reason to avoid an integer divide? I think it'd be a lot easier to read that way and the compiler can figure out the best code to generate for a given platform. Sadly, divides are still slow on modern CPUs. And since this is integer, one can't prerecompute the reciprocal and do a multiply, as you can in FP. This trick is used a lot in skia (see SkMulDiv255Round). The compiler can't do this optimization, since it's only valid for a restricted set of inputs, which the compiler doesn't know.
Stephen White
Comment 4 2010-11-10 12:16:16 PST
WebKit Review Bot
Comment 5 2010-11-10 13:14:27 PST
http://trac.webkit.org/changeset/71760 might have broken GTK Linux 32-bit Release
Note You need to log in before you can comment on or make changes to this bug.