RESOLVED FIXED 61646
Duplicate Fonts Put in Font Cache on Mac Due to Duplicate CGFontRefs for Same Font
https://bugs.webkit.org/show_bug.cgi?id=61646
Summary Duplicate Fonts Put in Font Cache on Mac Due to Duplicate CGFontRefs for Same...
Michael Saboff
Reported 2011-05-27 10:14:15 PDT
Core Text has code paths that call into CGFontCreateFontsWithPath() directly, bypassing CG’s font database. This can and does (in TOT WebKit, for example) result in multiple distinct CGFont objects being created for the exact same font. See <rdar://problem/9089228>for details. Every time we get a new and distinct CGFontRef, we create a new FontCache entry and abandon the old one. The cache fails to find the earlier entry due to FontPlatformData::platformIsEqual() in FontPlatformDataCocoa.mm comparing the saved m_cfFont.
Attachments
Patch to only compare the CGFontRefs if needed (1.49 KB, patch)
2011-05-27 10:20 PDT, Michael Saboff
hyatt: review+
Michael Saboff
Comment 1 2011-05-27 10:20:40 PDT
Created attachment 95189 [details] Patch to only compare the CGFontRefs if needed
Michael Saboff
Comment 2 2011-05-27 10:28:54 PDT
Adam Roben (:aroben)
Comment 3 2011-05-27 10:43:10 PDT
Comment on attachment 95189 [details] Patch to only compare the CGFontRefs if needed View in context: https://bugs.webkit.org/attachment.cgi?id=95189&action=review > Source/WebCore/ChangeLog:9 > + Change the platformIsEqual to just compare the m_font members if > + both are not null. This doesn't match the code change. We compare the m_font members if either one is not null, not if both are not null.
Dave Hyatt
Comment 4 2011-05-27 10:47:54 PDT
Comment on attachment 95189 [details] Patch to only compare the CGFontRefs if needed r=me
Michael Saboff
Comment 5 2011-05-27 10:52:19 PDT
Note You need to log in before you can comment on or make changes to this bug.