[Webkit-unassigned] [Bug 98285] Improve image decoding and rendering performance for animated GIFs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 29 16:05:24 PDT 2012


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





--- Comment #2 from Peter Kasting <pkasting at google.com>  2012-10-29 16:06:40 PST ---
(In reply to comment #1)
> 2. GIFImageDecoder shouldn't be destroyed when cached is cleared
> 
> Current implementation of ImageSource.cpp is that it deletes the entire GIFImageDecoder when it is instructed to remove all frame cache. If (1) is landed redecode will be cheaper without parsing.

I'm not convinced we should do this.  "Destroy everything" seems like it should mean "destroy everything".  We already have some granularity in our clearing logic that lets us nuke the framebuffer data but keep the metadata.  It's not obvious anything else should change here.

> 3. Simplify caching logic for multiframe GIFs
> 
> The logic for multiframe caching is too complicated. It has this clear-before-frame logic that allows some of the frames to be removed from cache. This seems overly complicated and doesn't do much. This logic also makes it much harder for us to implement frame skipping.

This all seems untrue.  The clear-before-frame logic is precisely how we implement keeping just the most recent frames, so it's not the case that it "doesn't do much".  I don't see how it's overly complicated (for what it needs to do) or makes frame skipping hard, either.

I think the code here is doing what you want and need it to do already.

There are another two items you didn't cover.

(5) We should extend the frame metadata to save the byte offsets within the file at which each frame begins.  This way, decode passes 2+ can avoid having to parse anything out of the file to skip through it.

(6) If we pay attention while writing the pixels to the frame buffer, we can detect cases where the frame is marked as needing the previous frame but in fact draws over all of it.  Then we can mark these as "dispose overwrite previous" in our metadata and allow for more frameskipping in future passes.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list