Skip to content

Instantly share code, notes, and snippets.

@torarnv
Created November 10, 2009 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torarnv/230871 to your computer and use it in GitHub Desktop.
Save torarnv/230871 to your computer and use it in GitHub Desktop.
diff --git i/WebCore/platform/graphics/qt/FontCacheQt.cpp w/WebCore/platform/graphics/qt/FontCacheQt.cpp
index 1113eae..469a72e 100644
--- i/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ w/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -177,15 +177,20 @@ typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCac
// using Q_GLOBAL_STATIC leads to crash. TODO investigate the way to fix this.
static FontPlatformDataCache* gFontPlatformDataCache = 0;
-FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString&, bool)
+FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString& family, bool)
{
if (!gFontPlatformDataCache)
gFontPlatformDataCache = new FontPlatformDataCache;
- FontPlatformDataCacheKey key(description);
+ FontDescription descriptionWithResolvedFamily(description);
+ FontFamily resolvedFamily;
+ resolvedFamily.setFamily(family);
+ descriptionWithResolvedFamily.setFamily(resolvedFamily);
+
+ FontPlatformDataCacheKey key(descriptionWithResolvedFamily);
FontPlatformData* platformData = gFontPlatformDataCache->get(key);
if (!platformData) {
- platformData = new FontPlatformData(description);
+ platformData = new FontPlatformData(descriptionWithResolvedFamily);
gFontPlatformDataCache->add(key, platformData);
}
return platformData;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment