Closed Bug 1054076 Opened 10 years ago Closed 10 years ago

Make imgFrame reference counted

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: seth, Assigned: seth)

References

Details

Attachments

(1 file, 1 obsolete file)

We need to start storing imgFrame objects in the surface cache instead of just SourceSurface objects, so that we can use the surface cache for things like HQ scaled frames. To do this, we need to start using reference counting to manage imgFrame objects.

One unfortunate thing is that this reference counting needs to be atomic, because decoders manipulate imgFrame objects off-main-thread. I think we can solve that problem but we should save that for a followup. (And there's probably no hurry if we don't actually notice a performance issue. I'm not convinced this will matter much in practice.)
Blocks: 1054079
Attached patch Make imgFrame reference counted (obsolete) — Splinter Review
Here's the patch to do it. It required touching a lot of code, unfortunately.

Try job here:
https://tbpl.mozilla.org/?tree=Try&rev=c53fcb3454c4
Attachment #8473336 - Flags: review?(tnikkel)
When testing bug 1054079 I noticed a bug in this patch: it's important not to copy the mFrameData member of FrameDataPair in the copy constructor and copy assignment operator. I've fixed that issue in this version of the patch, which is otherwise the same.

New try job here:
https://tbpl.mozilla.org/?tree=Try&rev=f53746b9141a
Attachment #8473350 - Flags: review?(tnikkel)
Attachment #8473336 - Attachment is obsolete: true
Attachment #8473336 - Flags: review?(tnikkel)
Comment on attachment 8473350 [details] [diff] [review]
Make imgFrame reference counted

Matt, it'd be great if you could take a look at the changes in imgFrame.cpp.
Attachment #8473350 - Flags: review?(matt.woodrow)
Attachment #8473350 - Flags: review?(matt.woodrow) → review+
Thanks for the review, Matt!

Those try failures appear to be from an issue with another patch far lower in the patch stack. I'll post a new try job when I've sorted those out. I don't see any failures that appear to be caused by this patch.
Attachment #8473350 - Flags: review?(tnikkel) → review+
Thanks Timothy!

Here's a new try job. It's not totally done running, but everything looks green so far.

https://tbpl.mozilla.org/?tree=Try&rev=bc01cdaac2c3
https://hg.mozilla.org/mozilla-central/rev/99fd6c8e7d36
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: