Closed Bug 545317 Opened 16 years ago Closed 16 years ago

Fonts are added multiple times to font cache

Categories

(Core :: Graphics, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jtd, Assigned: jtd)

References

Details

Attachments

(1 file)

As part of the refactoring done in font code for future harfbuzz support, the GetOrMakeFont method of gfxFontEntry calls a virtual method CreateFontInstance to create an derived instance of gfxFont and adds it to the font cache. The code in CreateFontInstance (GDI, Mac) also adds the font to the font cache.
The simple solution is to only add the font to the font cache in GetOrMakeFont. The rename avoids confusion between the static method (e.g. gfxWindowsFont::GetOrMakeFont) and the related gfxFontEntry method.
Attachment #426159 - Flags: review?(jfkthame)
Comment on attachment 426159 [details] [diff] [review] patch, v.0.1a, trim out redundant code and rename cache lookup method Looks fine to me. (AFAICS, the cache should have handled things ok, so the redundant code was not actually harmful except for wasting some cycles and making things more confusing - both of which are of course good to get fixed.)
Attachment #426159 - Flags: review?(jfkthame) → review+
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: