[Webkit-unassigned] [Bug 38701] [chromium] don't call fontconfig twice in complex text path

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 4 19:33:22 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38701





--- Comment #22 from ningxin hu <ningxin.hu at gmail.com>  2010-08-04 19:33:21 PST ---
As my opinion, call SkTypeface::CreateForChars in getFontDataForCharacters is enough to match a correct font (just like what r59483 does). 

getFontDataForCharacters passes the characters and style in, SkTypeface::CreateForChars uses all of them to match a font, there is no information loss.

In previous implementation, getFontDataForCharacters uses ChromiumBridge::getFontFamilyForCharacters to map characters to font family. Then createFontPlatformData uses family name and style to call SkTypeface::CreateFromName to match a font, there is information loss, since fonts with different char coverage might have same family name. (case is http://code.google.com/p/chromium/issues/detail?id=32109)

The issue of r59483 is performance loss. I constructed a similar page_cycler test as page_cycler_intl1, and reproduced it. As my finding, the root cause is ChromiumBridge::getFontFamilyForCharacters has cache to avoid some IPC (in RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters). However, in r59483, each SkTypeface::CreateForChars involves IPC.

I wrote a patch to add a typeface cache into r59483, the performance loss disappears. For memory usage,  RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters cache is purged when PurgeRenderers. So I purge the typeface cache when FontCache invalidate. But it involves WebKit API change, other platforms need to modify too. At least, Windows platform (FontCacheChromiumWin) has a FontCmapCache which needs to purge too. 

Please review this patch. Your comments are appreciated.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list