Closed Bug 588975 Opened 11 years ago Closed 9 years ago

Stop animating images in background tabs

Categories

(Core :: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
blocking-fennec1.0 --- -

People

(Reporter: azakai, Unassigned)

References

Details

(Keywords: perf)

Carefully, though - need to remember where they are, and fast-forward them when the tab returns to the top. See helpful comment at https://bugzilla.mozilla.org/show_bug.cgi?id=359608#c29
Assignee: nobody → azakai
Depends on: 359608
tracking-fennec: --- → 2.0+
Blocks: 592751
Sounds like a duplicate of bug 120154 - animated GIF eating cpu when mozilla in another tab or minimized.
Given all the fallout from bug 359608, I think it is not realistic to tackle this any time soon.
Depends on: 594771, 601723
Fennec shouldn't block on this.
tracking-fennec: 2.0+ → ---
Assignee: azakai → nobody
Version: unspecified → Trunk
Depends on: 633421
I was about to file this because it noticeably shortens battery life and probably also responsiveness. How are the chances of this getting fixed?
Keywords: perf
Aren't images in background tabs throttled down to 1fps now that they're on the refresh driver?
Refresh driver is throttled to exponential backoff, not 1fps.

For the rest, good question...
I think this will probably be required as part of bug 686905, at least if we want to discard animated image frames from background tabs.

I'm not sure if this is the idea, but we might be able to save memory by discarding frames that aren't being used at the moment. This would require that we redecode, though, but we could save the state of the image & then immediately jump to it once we've done the redecode.
I think this bug is just about not running the animation code and the timers for it for images in background tabs, not about the image data per se.
Small question: could animation also be stopped if window with it completely covered by other window?
That's actually very difficult to impossible to detect (e.g. just because you're covered doesn't mean you're invisible: windows can be translucent or transparent).
The former doesn't apply because this has nothing to do with painting.  The latter may apply, but the cost of doing the check may well be comparable to the animation cost.  Worth investigating, but in a separate bug.
tracking-fennec: --- → ?
blocking-fennec1.0: --- → ?
tracking-fennec: ? → 14+
blocking-fennec1.0: ? → -
Couldn't this be done by imageAnimationMode on nsidomwindowutils?
http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl#93
qawanted to retest
Keywords: qawanted
qawanted: martijn will retest.
I tested with Fennec trunk on the Galaxy Nexus with this animated gif counter going to 0: http://people.mozilla.com/~mwargers/tests/images/60.gif
It seems the counting down is stopping after 5 seconds or so when it is in the background tab.
tracking-fennec: 14+ → ?
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
tracking-fennec: ? → ---
Issue is resolved - clearing old keywords - qa-wanted clean-up
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.