Title: [174517] trunk/Source
Revision
174517
Author
[email protected]
Date
2014-10-09 12:16:05 -0700 (Thu, 09 Oct 2014)

Log Message

Remove second-to-last client of WebFontCache
https://bugs.webkit.org/show_bug.cgi?id=137550

Reviewed by Darin Adler.

Source/WebCore:

No new tests because no behavior change.

* WebCore.exp.in:
* platform/graphics/FontCache.h: Allow migration of client to getCachedFontData()

Source/WebKit/mac:

Use FontCache::getCachedFontData() instead of WebFontCache.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _addToStyle:fontA:fontB:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (174516 => 174517)


--- trunk/Source/WebCore/ChangeLog	2014-10-09 19:05:51 UTC (rev 174516)
+++ trunk/Source/WebCore/ChangeLog	2014-10-09 19:16:05 UTC (rev 174517)
@@ -1,3 +1,15 @@
+2014-10-09  Myles C. Maxfield  <[email protected]>
+
+        Remove second-to-last client of WebFontCache
+        https://bugs.webkit.org/show_bug.cgi?id=137550
+
+        Reviewed by Darin Adler.
+
+        No new tests because no behavior change.
+
+        * WebCore.exp.in:
+        * platform/graphics/FontCache.h: Allow migration of client to getCachedFontData()
+
 2014-10-09  Chris Dumez  <[email protected]>
 
         [Mac] Spending too much time mapping desired font families to available ones

Modified: trunk/Source/WebCore/WebCore.exp.in (174516 => 174517)


--- trunk/Source/WebCore/WebCore.exp.in	2014-10-09 19:05:51 UTC (rev 174516)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-10-09 19:16:05 UTC (rev 174517)
@@ -1404,6 +1404,7 @@
 __ZN7WebCore9FloatSizeC1ERKNS_7IntSizeE
 __ZN7WebCore9FontCache10invalidateEv
 __ZN7WebCore9FontCache13fontDataCountEv
+__ZN7WebCore9FontCache17getCachedFontDataERKNS_15FontDescriptionERKN3WTF12AtomicStringEbNS0_12ShouldRetainE
 __ZN7WebCore9FontCache21inactiveFontDataCountEv
 __ZN7WebCore9FontCache21purgeInactiveFontDataEi
 __ZN7WebCore9FontCache29purgeInactiveFontDataIfNeededEv
@@ -2744,7 +2745,6 @@
 __ZN7WebCore8Settings31setAudioSessionCategoryOverrideEj
 __ZN7WebCore8Settings34setNetworkDataUsageTrackingEnabledEb
 __ZN7WebCore8Settings38gShouldOptOutOfNetworkStateObservationE
-__ZN7WebCore9FontCache17getCachedFontDataERKNS_15FontDescriptionERKN3WTF12AtomicStringEbNS0_12ShouldRetainE
 __ZN7WebCore9FontCache25getLastResortFallbackFontERKNS_15FontDescriptionENS0_12ShouldRetainE
 __ZN7WebCore9FrameView17setScrollVelocityEdddd
 __ZN7WebCore9FrameView20setWasScrolledByUserEb

Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (174516 => 174517)


--- trunk/Source/WebCore/platform/graphics/FontCache.h	2014-10-09 19:05:51 UTC (rev 174516)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2014-10-09 19:16:05 UTC (rev 174517)
@@ -133,7 +133,7 @@
 
     void getTraitsInFamily(const AtomicString&, Vector<unsigned>&);
 
-    PassRefPtr<SimpleFontData> getCachedFontData(const FontDescription&, const AtomicString&, bool checkingAlternateName = false, ShouldRetain = Retain);
+    WEBCORE_EXPORT PassRefPtr<SimpleFontData> getCachedFontData(const FontDescription&, const AtomicString&, bool checkingAlternateName = false, ShouldRetain = Retain);
     WEBCORE_EXPORT PassRefPtr<SimpleFontData> getLastResortFallbackFont(const FontDescription&, ShouldRetain = Retain);
     SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&);
 

Modified: trunk/Source/WebKit/mac/ChangeLog (174516 => 174517)


--- trunk/Source/WebKit/mac/ChangeLog	2014-10-09 19:05:51 UTC (rev 174516)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-10-09 19:16:05 UTC (rev 174517)
@@ -1,3 +1,15 @@
+2014-10-09  Myles C. Maxfield  <[email protected]>
+
+        Remove second-to-last client of WebFontCache
+        https://bugs.webkit.org/show_bug.cgi?id=137550
+
+        Reviewed by Darin Adler.
+
+        Use FontCache::getCachedFontData() instead of WebFontCache.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _addToStyle:fontA:fontB:]):
+
 2014-10-09  Chris Dumez  <[email protected]>
 
         Use is<>() / downcast<>() for Widget subclasses

Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (174516 => 174517)


--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2014-10-09 19:05:51 UTC (rev 174516)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2014-10-09 19:16:05 UTC (rev 174517)
@@ -90,6 +90,7 @@
 #import <WebCore/ExceptionHandlers.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/FocusController.h>
+#import <WebCore/FontCache.h>
 #import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/FrameSelection.h>
@@ -4894,13 +4895,16 @@
         // the Postscript name.
         
         // Find the font the same way the rendering code would later if it encountered this CSS.
-        NSFontTraitMask traits = aIsItalic ? NSFontItalicTrait : 0;
-        int weight = aIsBold ? STANDARD_BOLD_WEIGHT : STANDARD_WEIGHT;
-        NSFont *foundFont = [WebFontCache fontWithFamily:aFamilyName traits:traits weight:weight size:aPointSize];
+        FontDescription fontDescription;
+        fontDescription.setItalic(aIsItalic);
+        fontDescription.setWeight(aIsBold ? FontWeight900 : FontWeight500);
+        fontDescription.setSpecifiedSize(aPointSize);
+        FontCachePurgePreventer purgePreventer;
+        RefPtr<SimpleFontData> simpleFontData = fontCache().getCachedFontData(fontDescription, aFamilyName, false, WebCore::FontCache::DoNotRetain);
 
         // If we don't find a font with the same Postscript name, then we'll have to use the
         // Postscript name to make the CSS specific enough.
-        if (![[foundFont fontName] isEqualToString:[a fontName]])
+        if (![[simpleFontData->platformData().font() fontName] isEqualToString:[a fontName]])
             familyNameForCSS = [a fontName];
 
         // FIXME: Need more sophisticated escaping code if we want to handle family names
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to