Closed Bug 1367538 Opened 2 years ago Closed 2 years ago

DrawTargetRecordings are kept alive by ScaledFonts

Categories

(Core :: Graphics, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Details

(Whiteboard: gfx-noted)

Attachments

(1 file)

DrawTargetRecording::FillGlyph adds a UserData containing a reference to the Recording. This keeps the recordings alive as long as the ScaledFont is around. This is likely not the best. We only want the UserData around while we're recording. After we're done we don't need them anymore.
Whiteboard: gfx-noted
SourceSurfaces do this too which seems to be an even greater cause of staying around.
This helps keep us from accumulating all of the recorders. 

The basic idea is to track weak references to the SourceSurfaces and Fonts that we add UserData to in DrawEventRecorderPrivate and then clear these UserData's when we're done recording.

This adds a RemoveAndDestroy helper to UserData to make this possible.
Assignee: nobody → jmuizelaar
Attachment #8871889 - Flags: review?(lsalzman)
Attachment #8871889 - Flags: review?(lsalzman) → review+
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5f65427cd949
Clear user data after we're done with the recorder. r=lsalzman
https://hg.mozilla.org/mozilla-central/rev/5f65427cd949
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.