Open Bug 1257388 Opened 7 years ago Updated 1 year ago

Play back all animated images via the media framework


(Core :: Graphics: ImageLib, task, P3)





(Reporter: seth, Unassigned)


(Depends on 2 open bugs, Blocks 6 open bugs)


(Whiteboard: [MemShrink:P2][gfx-noted])

Right now, to play back an animated image we have to decode every frame in the image and keep them all in memory. This can result in massive memory usage for large animated images, which can lead to either allocation failures that prevent the images from displaying, or OOMs that kill the browser.

In this bug we'll solve that problem by moving animated image playback to the media framework. We'll replace the existing image animation system with media decoders for image/png and image/gif which decode the images in a streaming fashion, just as we would with video. This should give us a number of nice properties for free; for example, we'll only allocate the memory for a few frames at a time instead of the entire image, we can remove all support for paletted images from ImageLib since in the media framework we can afford to work directly in BGRA/BGRX, and features like pausing animation when the animated image is scrolled out of view should "just work".
Blocks: 1247520
Blocks: 1234023
Blocks: 129986
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink:P1]
Depends on: streaming-gif
See Also: → 1295501
Blocks: 523950
Andrew: is this something that might get fixed by your aGIF work?
Assignee: seth.bugzilla → nobody
Flags: needinfo?(aosmond)
I would say bug 523950 is a stepping stone towards using the media framework, if we prioritize it eventually, but no more than that. It does give some of the same benefits though.
Flags: needinfo?(aosmond)
Priority: -- → P3
Whiteboard: [MemShrink:P1] → [MemShrink:P1][gfx-noted]
Whiteboard: [MemShrink:P1][gfx-noted] → [MemShrink:P2][gfx-noted]
Blocks: 1621548, 1631598
Type: defect → task
Blocks: 560084
Blocks: 895131
You need to log in before you can comment on or make changes to this bug.