[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

jchaffraix at webkit.org jchaffraix at webkit.org
Fri Feb 26 22:16:55 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 489e67d7372edfd287bf498ce5f86e4df25ac74d
Author: jchaffraix at webkit.org <jchaffraix at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 10 16:28:27 2010 +0000

    Bug 23287 -  Avoid using FontPlatformData outside the FontCache
    
    Patch by Julien Chaffraix <jchaffraix at pleyo.com> on 2010-02-10
    Reviewed by Eric Seidel.
    
    No functional change, only refactored the code using FontPlatformData to use SimpleFontData.
    
    This change leaves the class FontCached as it needs some thoughts and more refactoring.
    
    * css/CSSFontFaceSource.cpp:
    (WebCore::CSSFontFaceSource::getFontData): Call getCachedFontData with the 2 parameters directly.
    * css/CSSFontSelector.cpp:
    (WebCore::fontDataForGenericFamily): Ditto.
    * platform/graphics/FontCache.cpp:
    (WebCore::FontCache::getCachedFontData): This method is meant to replace getCachedFontPlatformData
    that was moved in the private section of the class. It calls getCachedFontPlatformData and cache
    the returned FontPlatformData if it is not null.
    (WebCore::FontCache::getFontData): Updated to use the new getCachedFontData.
    * platform/graphics/FontCache.h: Updated several methods to return a SimpleFontData in lieu of a
    FontPlatformData. Moved some method in the private sections.
    
    * platform/graphics/chromium/FontCacheChromiumWin.cpp:
    (WebCore::FontCache::getSimilarFontPlatformData):
    (WebCore::FontCache::getLastResortFallbackFont):
    * platform/graphics/chromium/FontCacheLinux.cpp:
    (WebCore::FontCache::getSimilarFontPlatformData):
    (WebCore::FontCache::getLastResortFallbackFont):
    * platform/graphics/gtk/FontCacheGtk.cpp:
    (WebCore::FontCache::getSimilarFontPlatformData):
    (WebCore::FontCache::getLastResortFallbackFont):
    * platform/graphics/haiku/FontCacheHaiku.cpp:
    (WebCore::FontCache::getSimilarFontPlatformData):
    (WebCore::FontCache::getLastResortFallbackFont):
    * platform/graphics/qt/FontCacheQt.cpp:
    (WebCore::FontCache::getLastResortFallbackFont):
    * platform/graphics/win/FontCacheWin.cpp:
    (WebCore::FontCache::getSimilarFontPlatformData):
    (WebCore::FontCache::getLastResortFallbackFont):
    * platform/graphics/wince/FontCacheWince.cpp:
    * platform/graphics/wx/FontCacheWx.cpp:
    (WebCore::FontCache::getSimilarFontPlatformData):
    (WebCore::FontCache::getLastResortFallbackFont):
    Updated all the previous platform methods to return a SimpleFontData.
    
    * platform/graphics/mac/FontCacheMac.mm:
    (WebCore::FontCache::getSimilarFontPlatformData): Updated to return a SimpleFontData.
    (WebCore::FontCache::getLastResortFallbackFont): Ditto. Also refactored the code
    and moved a DEFINE_STATIC_LOCAL where it is needed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 258d99d..2c1d435 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,53 @@
+2010-02-10 Julien Chaffraix  <jchaffraix at pleyo.com>
+
+        Reviewed by Eric Seidel.
+
+        Bug 23287 -  Avoid using FontPlatformData outside the FontCache
+
+        No functional change, only refactored the code using FontPlatformData to use SimpleFontData.
+
+        This change leaves the class FontCached as it needs some thoughts and more refactoring.
+
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::getFontData): Call getCachedFontData with the 2 parameters directly.
+        * css/CSSFontSelector.cpp:
+        (WebCore::fontDataForGenericFamily): Ditto.
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::getCachedFontData): This method is meant to replace getCachedFontPlatformData
+        that was moved in the private section of the class. It calls getCachedFontPlatformData and cache
+        the returned FontPlatformData if it is not null.
+        (WebCore::FontCache::getFontData): Updated to use the new getCachedFontData.
+        * platform/graphics/FontCache.h: Updated several methods to return a SimpleFontData in lieu of a
+        FontPlatformData. Moved some method in the private sections.
+
+        * platform/graphics/chromium/FontCacheChromiumWin.cpp:
+        (WebCore::FontCache::getSimilarFontPlatformData):
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/chromium/FontCacheLinux.cpp:
+        (WebCore::FontCache::getSimilarFontPlatformData):
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/gtk/FontCacheGtk.cpp:
+        (WebCore::FontCache::getSimilarFontPlatformData):
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/haiku/FontCacheHaiku.cpp:
+        (WebCore::FontCache::getSimilarFontPlatformData):
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/qt/FontCacheQt.cpp:
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::getSimilarFontPlatformData):
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/wince/FontCacheWince.cpp:
+        * platform/graphics/wx/FontCacheWx.cpp:
+        (WebCore::FontCache::getSimilarFontPlatformData):
+        (WebCore::FontCache::getLastResortFallbackFont):
+        Updated all the previous platform methods to return a SimpleFontData.
+
+        * platform/graphics/mac/FontCacheMac.mm:
+        (WebCore::FontCache::getSimilarFontPlatformData): Updated to return a SimpleFontData.
+        (WebCore::FontCache::getLastResortFallbackFont): Ditto. Also refactored the code
+        and moved a DEFINE_STATIC_LOCAL where it is needed.
+
 2010-02-10  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp
index 111cea2..1354e68 100644
--- a/WebCore/css/CSSFontFaceSource.cpp
+++ b/WebCore/css/CSSFontFaceSource.cpp
@@ -107,8 +107,7 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
 #else
     if (!m_font) {
 #endif
-        FontPlatformData* data = fontCache()->getCachedFontPlatformData(fontDescription, m_string);
-        SimpleFontData* fontData = fontCache()->getCachedFontData(data);
+        SimpleFontData* fontData = fontCache()->getCachedFontData(fontDescription, m_string);
 
         // We're local. Just return a SimpleFontData from the normal cache.
         return fontData;
@@ -179,10 +178,11 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
         if (DocLoader* docLoader = fontSelector->docLoader())
             m_font->beginLoadIfNeeded(docLoader);
         // FIXME: m_string is a URL so it makes no sense to pass it as a family name.
-        FontPlatformData* tempData = fontCache()->getCachedFontPlatformData(fontDescription, m_string);
+        SimpleFontData* tempData = fontCache()->getCachedFontData(fontDescription, m_string);
         if (!tempData)
             tempData = fontCache()->getLastResortFallbackFont(fontDescription);
-        fontData.set(new SimpleFontData(*tempData, true, true));
+
+        fontData.set(new SimpleFontData(tempData->platformData(), true, true));
     }
 
     m_fontDataTable.set(hashKey, fontData.get());
diff --git a/WebCore/css/CSSFontSelector.cpp b/WebCore/css/CSSFontSelector.cpp
index ce3253c..56ee261 100644
--- a/WebCore/css/CSSFontSelector.cpp
+++ b/WebCore/css/CSSFontSelector.cpp
@@ -394,7 +394,7 @@ static FontData* fontDataForGenericFamily(Document* document, const FontDescript
         genericFamily = settings->standardFontFamily();
 
     if (!genericFamily.isEmpty())
-        return fontCache()->getCachedFontData(fontCache()->getCachedFontPlatformData(fontDescription, genericFamily));
+        return fontCache()->getCachedFontData(fontDescription, genericFamily);
 
     return 0;
 }
diff --git a/WebCore/platform/graphics/FontCache.cpp b/WebCore/platform/graphics/FontCache.cpp
index 2aa68f1..b3eca85 100644
--- a/WebCore/platform/graphics/FontCache.cpp
+++ b/WebCore/platform/graphics/FontCache.cpp
@@ -257,6 +257,15 @@ const int cMaxInactiveFontData = 120;  // Pretty Low Threshold
 const float cTargetInactiveFontData = 100;
 static ListHashSet<const SimpleFontData*>* gInactiveFontData = 0;
 
+SimpleFontData* FontCache::getCachedFontData(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName)
+{
+    FontPlatformData* platformData = getCachedFontPlatformData(fontDescription, family, checkingAlternateName);
+    if (!platformData)
+        return 0;
+
+    return getCachedFontData(platformData);
+}
+
 SimpleFontData* FontCache::getCachedFontData(const FontPlatformData* platformData)
 {
     if (!platformData)
@@ -361,7 +370,7 @@ size_t FontCache::inactiveFontDataCount()
 
 const FontData* FontCache::getFontData(const Font& font, int& familyIndex, FontSelector* fontSelector)
 {
-    FontPlatformData* result = 0;
+    SimpleFontData* result = 0;
 
     int startIndex = familyIndex;
     const FontFamily* startFamily = &font.fontDescription().family();
@@ -376,7 +385,7 @@ const FontData* FontCache::getFontData(const Font& font, int& familyIndex, FontS
                 if (data)
                     return data;
             }
-            result = getCachedFontPlatformData(font.fontDescription(), currFamily->family());
+            result = getCachedFontData(font.fontDescription(), currFamily->family());
         }
         currFamily = currFamily->next();
     }
@@ -403,9 +412,7 @@ const FontData* FontCache::getFontData(const Font& font, int& familyIndex, FontS
         // Still no result.  Hand back our last resort fallback font.
         result = getLastResortFallbackFont(font.fontDescription());
     }
-
-    // Now that we have a result, we need to go from FontPlatformData -> FontData.
-    return getCachedFontData(result);
+    return result;
 }
 
 static HashSet<FontSelector*>* gClients;
diff --git a/WebCore/platform/graphics/FontCache.h b/WebCore/platform/graphics/FontCache.h
index 9b41e38..dd5928d 100644
--- a/WebCore/platform/graphics/FontCache.h
+++ b/WebCore/platform/graphics/FontCache.h
@@ -78,9 +78,8 @@ public:
 
     void getTraitsInFamily(const AtomicString&, Vector<unsigned>&);
 
-    FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
-    SimpleFontData* getCachedFontData(const FontPlatformData*);
-    FontPlatformData* getLastResortFallbackFont(const FontDescription&);
+    SimpleFontData* getCachedFontData(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName = false);
+    SimpleFontData* getLastResortFallbackFont(const FontDescription&);
 
     void addClient(FontSelector*);
     void removeClient(FontSelector*);
@@ -96,16 +95,22 @@ private:
     FontCache();
     ~FontCache();
 
+    // FIXME: This method should eventually be removed.
+    FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
+
     // These methods are implemented by each platform.
-    FontPlatformData* getSimilarFontPlatformData(const Font&);
+    SimpleFontData* getSimilarFontPlatformData(const Font&);
     FontPlatformData* createFontPlatformData(const FontDescription&, const AtomicString& family);
 
-    friend class SimpleFontData;
+    SimpleFontData* getCachedFontData(const FontPlatformData*);
+
+    friend class SimpleFontData; // For getCachedFontData(const FontPlatformData*)
     friend class FontFallbackList;
 };
 
 // Get the global fontCache.
 FontCache* fontCache();
+
 }
 
 #endif
diff --git a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
index e8fa860..8dac612 100644
--- a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
@@ -406,12 +406,12 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
 
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& description)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& description)
 {
     FontDescription::GenericFamilyType generic = description.genericFamily();
 
@@ -428,7 +428,7 @@ FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& de
     else if (generic == FontDescription::MonospaceFamily)
         fontStr = courierStr;
 
-    return getCachedFontPlatformData(description, fontStr);
+    return getCachedFontData(description, fontStr);
 }
 
 static LONG toGDIFontWeight(FontWeight fontWeight)
diff --git a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
index 3fe1561..03d23c7 100644
--- a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
@@ -66,12 +66,12 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font,
     return getCachedFontData(getCachedFontPlatformData(font.fontDescription(), atomicFamily, false));
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& description)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& description)
 {
     static const AtomicString sansStr("Sans");
     static const AtomicString serifStr("Serif");
@@ -92,7 +92,7 @@ FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& de
     }
 
     ASSERT(fontPlatformData);
-    return fontPlatformData;
+    return getCachedFontData(fontPlatformData);
 }
 
 void FontCache::getTraitsInFamily(const AtomicString& familyName,
diff --git a/WebCore/platform/graphics/gtk/FontCacheGtk.cpp b/WebCore/platform/graphics/gtk/FontCacheGtk.cpp
index e0b88da..d2b2f39 100644
--- a/WebCore/platform/graphics/gtk/FontCacheGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontCacheGtk.cpp
@@ -59,17 +59,17 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     return 0;
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
     // FIXME: Would be even better to somehow get the user's default font here.
     // For now we'll pick the default that the user would get without changing any prefs.
     static AtomicString timesStr("Times New Roman");
-    return getCachedFontPlatformData(fontDescription, timesStr);
+    return getCachedFontData(fontDescription, timesStr);
 }
 
 void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks)
diff --git a/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp b/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp
index b99bf42..7ade370 100644
--- a/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp
@@ -51,18 +51,18 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     return getCachedFontData(&data);
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     notImplemented();
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
     // FIXME: Would be even better to somehow get the user's default font here.
     // For now we'll pick the default that the user would get without changing any prefs.
     static AtomicString defaultString("DejaVu Serif");
-    return getCachedFontPlatformData(fontDescription, defaultString);
+    return getCachedFontData(fontDescription, defaultString);
 }
 
 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
diff --git a/WebCore/platform/graphics/mac/FontCacheMac.mm b/WebCore/platform/graphics/mac/FontCacheMac.mm
index 2730d5a..0747dd7 100644
--- a/WebCore/platform/graphics/mac/FontCacheMac.mm
+++ b/WebCore/platform/graphics/mac/FontCacheMac.mm
@@ -146,43 +146,43 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     return getCachedFontData(&alternateFont);
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     // Attempt to find an appropriate font using a match based on 
     // the presence of keywords in the the requested names.  For example, we'll
     // match any name that contains "Arabic" to Geeza Pro.
-    FontPlatformData* platformData = 0;
+    SimpleFontData* simpleFontData = 0;
     const FontFamily* currFamily = &font.fontDescription().family();
-    while (currFamily && !platformData) {
+    while (currFamily && !simpleFontData) {
         if (currFamily->family().length()) {
             static String* matchWords[3] = { new String("Arabic"), new String("Pashto"), new String("Urdu") };
             DEFINE_STATIC_LOCAL(AtomicString, geezaStr, ("Geeza Pro"));
-            for (int j = 0; j < 3 && !platformData; ++j)
+            for (int j = 0; j < 3 && !simpleFontData; ++j)
                 if (currFamily->family().contains(*matchWords[j], false))
-                    platformData = getCachedFontPlatformData(font.fontDescription(), geezaStr);
+                    simpleFontData = getCachedFontData(font.fontDescription(), geezaStr);
         }
         currFamily = currFamily->next();
     }
 
-    return platformData;
+    return simpleFontData;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
     DEFINE_STATIC_LOCAL(AtomicString, timesStr, ("Times"));
-    DEFINE_STATIC_LOCAL(AtomicString, lucidaGrandeStr, ("Lucida Grande"));
 
     // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
     // the default that the user would get without changing any prefs.
-    FontPlatformData* platformFont = getCachedFontPlatformData(fontDescription, timesStr);
-    if (!platformFont)
-        // The Times fallback will almost always work, but in the highly unusual case where
-        // the user doesn't have it, we fall back on Lucida Grande because that's
-        // guaranteed to be there, according to Nathan Taylor. This is good enough
-        // to avoid a crash at least.
-        platformFont = getCachedFontPlatformData(fontDescription, lucidaGrandeStr);
-
-    return platformFont;
+    SimpleFontData* simpleFontData = getCachedFontData(fontDescription, timesStr);
+    if (simpleFontData)
+        return simpleFontData;
+
+    // The Times fallback will almost always work, but in the highly unusual case where
+    // the user doesn't have it, we fall back on Lucida Grande because that's
+    // guaranteed to be there, according to Nathan Taylor. This is good enough
+    // to avoid a crash at least.
+    DEFINE_STATIC_LOCAL(AtomicString, lucidaGrandeStr, ("Lucida Grande"));
+    return getCachedFontData(fontDescription, lucidaGrandeStr);
 }
 
 void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks)
diff --git a/WebCore/platform/graphics/qt/FontCacheQt.cpp b/WebCore/platform/graphics/qt/FontCacheQt.cpp
index 83df0f3..bfcc5c3 100644
--- a/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -49,15 +49,15 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font&, const UCh
     return 0;
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
     const AtomicString fallbackFamily = QFont(fontDescription.family().family()).lastResortFamily();
-    return new FontPlatformData(fontDescription, fallbackFamily);
+    return getCachedFontData(new FontPlatformData(fontDescription, fallbackFamily));
 }
 
 void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)
diff --git a/WebCore/platform/graphics/win/FontCacheWin.cpp b/WebCore/platform/graphics/win/FontCacheWin.cpp
index 5e61ef3..8b082fa 100644
--- a/WebCore/platform/graphics/win/FontCacheWin.cpp
+++ b/WebCore/platform/graphics/win/FontCacheWin.cpp
@@ -296,12 +296,12 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     return fontData;
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
     // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
     // the default that the user would get without changing any prefs.
@@ -316,7 +316,7 @@ FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fo
         GetObject(defaultGUIFont, sizeof(logFont), &logFont);
         defaultGUIFontFamily = String(logFont.lfFaceName, wcsnlen(logFont.lfFaceName, LF_FACESIZE));
     }
-    return getCachedFontPlatformData(fontDescription, defaultGUIFontFamily);
+    return getCachedFontData(fontDescription, defaultGUIFontFamily);
 }
 
 static LONG toGDIFontWeight(FontWeight fontWeight)
diff --git a/WebCore/platform/graphics/wince/FontCacheWince.cpp b/WebCore/platform/graphics/wince/FontCacheWince.cpp
index f67f1b4..3262fc0 100644
--- a/WebCore/platform/graphics/wince/FontCacheWince.cpp
+++ b/WebCore/platform/graphics/wince/FontCacheWince.cpp
@@ -316,16 +316,16 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     return 0;
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
     return 0;
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDesc)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDesc)
 {
     // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
     // the default that the user would get without changing any prefs.
-    return getCachedFontPlatformData(fontDesc, FontPlatformData::defaultFontFamily());
+    return getCachedFontData(fontDesc, FontPlatformData::defaultFontFamily());
 }
 
 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
diff --git a/WebCore/platform/graphics/wx/FontCacheWx.cpp b/WebCore/platform/graphics/wx/FontCacheWx.cpp
index db107e4..b2dea2e 100644
--- a/WebCore/platform/graphics/wx/FontCacheWx.cpp
+++ b/WebCore/platform/graphics/wx/FontCacheWx.cpp
@@ -46,17 +46,17 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     return fontData;
 }
 
-FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
+SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
 {
-    return new FontPlatformData(font.fontDescription(), font.family().family());
+    return getCachedFontData(font.fontDescription(), font.family().family());
 }
 
-FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
+SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
     // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
     // the default that the user would get without changing any prefs.
     static AtomicString timesStr("systemfont");
-    return getCachedFontPlatformData(fontDescription, timesStr);
+    return getCachedFontData(fontDescription, timesStr);
 }
 
 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list