It currently looks like animated images can be made into layers without too much (any?) work, but we need to make sure this is the case. In particular, GetCurrentImage() needs to be called to update the Image on the ImageContainer whenever the frame is changed by RequestRefresh() (which is itself called by the refresh driver).
The code for turning nsDisplayImage into an active layer definitely exists (and works last time I checked). I don't believe it has ever been used by default for anything though, so bugs likely exist. We're using the equivalent path in nsDisplayBackgroundImage now, and hit a few issues when enabling that.
I'm running a try build of bug 867770, which enables layerizing of at least some animated images. If it works I'll just close this bug as worksforme. https://tbpl.mozilla.org/?tree=Try&rev=5229887b24c4
12:50:24 INFO - REFTEST TEST-UNEXPECTED-FAIL | file:///builds/slave/test/build/tests/reftest/tests/image/test/reftest/gif/delaytest.html?transparent-animation.gif | load failed: timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint) Looks like I need to fix the reftest framework to handle this situation.
The problem that the reftest framework is running in to is that it thinks there's a draw pending (isMozAfterPaintPending is true) but one never comes. I presume this is because we've converted the Thebes layer into an Image layer before the draw has a chance to be cleared. Matt, is this something we've ever had to deal with before?
MozAfterPaint should still be fired, even if the only changes are to non-ThebesLayer layers. In fact, if we return true to isMozAfterPaintPending then we add an empty rect to the MozAfterPaint list to make sure that we always get something fired. http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresContext.cpp#137
Created attachment 755719 [details] [diff] [review] Recycle image layers instead of creating them every time The paint events were happening, the problem was that they didn't *stop* happening. Every time we built layers, we created a new ImageLayer, which DLBI picks up and sends a MozAfterPaint. Reftest takes a new snapshot, which builds layers, and triggers another MozAfterPaint. Repeat forever.
Comment on attachment 755719 [details] [diff] [review] Recycle image layers instead of creating them every time Review of attachment 755719 [details] [diff] [review]: ----------------------------------------------------------------- ooh, nice catch.
hey matt, next time can you just fix all my bugs so I can go on holiday