Closed
Bug 1393185
Opened 7 years ago
Closed 7 years ago
Avoid refcount churn due to gfxFT2LockedFace
Categories
(Core :: Graphics: Text, enhancement)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
(deleted),
patch
|
lsalzman
:
review+
|
Details | Diff | Splinter Review |
As a temporary (stack-based) helper, gfxFT2LockedFace doesn't need to hold a strong reference to the gfxFT2FontBase. Doing so causes unnecessary refcount twiddling.
This is particularly troublesome because gfxFT2LockedFace is used from within the gfxFontconfigFont constructor (via gfxFT2FontBase::InitMetrics), at which point the font being constructed has a refcount of zero. This means that using gfxFT2LockedFace to lock and access the FT_Face will bump the refcount to 1; then as the gfxFT2LockedFace goes out of scope again, the font's refcount drops back to zero; so gfxFont::Release figures we're done with the font and adds it to the gfxFontCache expiration-tracker list for eventual destruction -- though in practice we'll almost immediately bump its refcount again, when assigning the newly-created gfxFontconfigFont to a refptr somewhere, and take it back out of the expiration tracker. All that is a bunch of wasted work, AFAICS.
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
AFAICS, it should be safe to simplify like this.
Attachment #8900424 -
Flags: review?(lsalzman)
Updated•7 years ago
|
Attachment #8900424 -
Flags: review?(lsalzman) → review+
Updated•7 years ago
|
Whiteboard: [gfx-noted]
Assignee | ||
Comment 3•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ffc8b060039e2edb00174b71e02448b68f135239
Bug 1393185 - Annotate gfxFT2LockedFace as a stack-based helper, and avoid touching the refcount of the font. r=lsalzman
Comment 4•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Updated•6 years ago
|
Assignee: nobody → jfkthame
You need to log in
before you can comment on or make changes to this bug.
Description
•