The image decoders in the GTK+/Cairo port and others are an old port of Mozilla code. Mozilla has been improving their code and it would be nice to track the changes: https://bugzilla.mozilla.org/show_bug.cgi?id=143046 Bug 143046 (slowGIF) – Need to Keep GIFs at original 8 bit or optimize
They also have some libjpeg enhancements: https://bugzilla.mozilla.org/show_bug.cgi?id=242145 This one's trickier since we don't bundle libjpeg. Maybe we need to get these fixes pushed into the distributions so we can take advantage of them. Didn't study the changes closely yet.
I could be mistaken, but I don't think the changes on https://bugzilla.mozilla.org/show_bug.cgi?id=143046 are directly applicable to the cross-platform decoders in WebKit. From a brief look, these are mostly changes to Mozilla's surrounding image architecture to allow the decoded frames to remain in 8bpp form instead of expanding to 24bpp. Right now in WebKit the decoded pixels are stored as 32bpp in all circumstances. We might be able to apply a similar idea, but none of the code will really translate. This will be especially tricky given the memory management around the decoded frames.
I would say this is not applicable, given the above? Should we close this bug?
It seems this should be closed. Feel free reopen it, if it seems necessary.