Changeset 59483 in webkit
- Timestamp:
- May 14, 2010 1:16:12 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r59482 r59483 1 2010-05-14 Evan Martin <evan@chromium.org> 2 3 Reviewed by David Levin. 4 5 [chromium] don't call fontconfig twice in complex text path 6 https://bugs.webkit.org/show_bug.cgi?id=38701 7 8 Previously getFontDataForCharacters would call fontconfig once to 9 resolve a font name, then pass that name to getCachedFontPlatformData 10 to load the font. This would be two trips through fontconfig (including 11 IPCs). With this change, we completely load the font in the first pass. 12 13 This patch is actually the same code as in r58341, which was reverted 14 because of a performance problem; a performance improvement has now 15 been committed, and with that change in place this change improves 16 the Chromium intl2 page cycler performance by another 5%. 17 18 See also https://bugs.webkit.org/show_bug.cgi?id=37904 . 19 20 Test: fast/text/international/bold-bengali.html 21 (Was checked in as part of the first attempt at this change, continues 22 to pass after this change.) 23 24 * platform/chromium/ChromiumBridge.h: 25 * platform/graphics/chromium/FontCacheLinux.cpp: 26 (WebCore::FontCache::getFontDataForCharacters): 27 1 28 2010-05-14 Young Han Lee <joybro@company100.net> 2 29 -
trunk/WebCore/platform/chromium/ChromiumBridge.h
r59465 r59483 126 126 #if OS(LINUX) 127 127 static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result); 128 // This code is currently in the process of getting rejiggered, and though 129 // it is not currently used, it will hopefully be used again soon. 128 130 static String getFontFamilyForCharacters(const UChar*, size_t numCharacters); 129 131 #endif -
trunk/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
r58447 r59483 59 59 int length) 60 60 { 61 String family = ChromiumBridge::getFontFamilyForCharacters(characters, length); 62 if (family.isEmpty()) 61 int style = SkTypeface::kNormal; 62 if (font.fontDescription().weight() >= FontWeightBold) 63 style |= SkTypeface::kBold; 64 if (font.fontDescription().italic()) 65 style |= SkTypeface::kItalic; 66 67 SkTypeface* tf = SkTypeface::CreateForChars(characters, length * 2, 68 static_cast<SkTypeface::Style>(style)); 69 if (!tf) 63 70 return 0; 64 71 65 AtomicString atomicFamily(family); 66 return getCachedFontData(getCachedFontPlatformData(font.fontDescription(), atomicFamily, false)); 72 // FIXME: we don't have a family name for this font. 73 // However, the family name within FontPlatformData is only used when picking 74 // a render style for the font, so it's not too great of a loss. 75 FontPlatformData result(tf, 76 "", 77 font.fontDescription().computedSize(), 78 (style & SkTypeface::kBold) && !tf->isBold(), 79 (style & SkTypeface::kItalic) && !tf->isItalic()); 80 tf->unref(); 81 return getCachedFontData(&result); 67 82 } 68 83
Note: See TracChangeset
for help on using the changeset viewer.