<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[180294] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/180294">180294</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-02-18 14:23:22 -0800 (Wed, 18 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename FontGlyphs to FontCascadeFonts
https://bugs.webkit.org/show_bug.cgi?id=141754

Reviewed by Andreas Kling.

&quot;It is better than Impl.&quot;

The purpose of the class to own to create and own the realized Font instances and the associated caches
for FontCascade instances.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCachecpp">trunk/Source/WebCore/platform/graphics/FontCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadecpp">trunk/Source/WebCore/platform/graphics/FontCascade.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadeh">trunk/Source/WebCore/platform/graphics/FontCascade.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontWincpp">trunk/Source/WebCore/platform/graphics/win/FontWin.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadeFontscpp">trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadeFontsh">trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontGlyphscpp">trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontGlyphsh">trunk/Source/WebCore/platform/graphics/FontGlyphs.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -2071,10 +2071,10 @@
</span><span class="cx">     platform/graphics/Font.cpp
</span><span class="cx">     platform/graphics/FontCache.cpp
</span><span class="cx">     platform/graphics/FontCascade.cpp
</span><ins>+    platform/graphics/FontCascadeFonts.cpp
</ins><span class="cx">     platform/graphics/FontDescription.cpp
</span><span class="cx">     platform/graphics/FontFeatureSettings.cpp
</span><span class="cx">     platform/graphics/FontGenericFamilies.cpp
</span><del>-    platform/graphics/FontGlyphs.cpp
</del><span class="cx">     platform/graphics/FontRanges.cpp
</span><span class="cx">     platform/graphics/GeneratedImage.cpp
</span><span class="cx">     platform/graphics/GeometryUtilities.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/ChangeLog        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-02-18  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Rename FontGlyphs to FontCascadeFonts
+        https://bugs.webkit.org/show_bug.cgi?id=141754
+
+        Reviewed by Andreas Kling.
+
+        &quot;It is better than Impl.&quot;
+
+        The purpose of the class to own to create and own the realized Font instances and the associated caches
+        for FontCascade instances.
+
</ins><span class="cx"> 2015-02-18  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r180286.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -8240,9 +8240,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\Font.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontCache.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontCascade.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\graphics\FontCascadeFonts.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontDescription.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontGenericFamilies.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\platform\graphics\FontGlyphs.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontFeatureSettings.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontPlatformData.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontRanges.cpp&quot; /&gt;
</span><span class="lines">@@ -19778,9 +19778,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\Font.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontCache.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontCascade.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\graphics\FontCascadeFonts.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontDescription.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontGenericFamilies.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\platform\graphics\FontGlyphs.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontFeatureSettings.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontMetrics.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\FontPlatformData.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -4724,8 +4724,8 @@
</span><span class="cx">                 B2C3DA640D006CD600EF6F26 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA530D006CD600EF6F26 /* Font.cpp */; };
</span><span class="cx">                 B2C3DA650D006CD600EF6F26 /* Font.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA540D006CD600EF6F26 /* Font.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA550D006CD600EF6F26 /* FontDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                B2C3DA670D006CD600EF6F26 /* FontGlyphs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA560D006CD600EF6F26 /* FontGlyphs.cpp */; };
-                B2C3DA680D006CD600EF6F26 /* FontGlyphs.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA570D006CD600EF6F26 /* FontGlyphs.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                B2C3DA670D006CD600EF6F26 /* FontCascadeFonts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA560D006CD600EF6F26 /* FontCascadeFonts.cpp */; };
+                B2C3DA680D006CD600EF6F26 /* FontCascadeFonts.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA570D006CD600EF6F26 /* FontCascadeFonts.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 B2C3DA6B0D006CD600EF6F26 /* FontSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C96D8D0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */; };
</span><span class="lines">@@ -12125,8 +12125,8 @@
</span><span class="cx">                 B2C3DA530D006CD600EF6F26 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2C3DA540D006CD600EF6F26 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2C3DA550D006CD600EF6F26 /* FontDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontDescription.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                B2C3DA560D006CD600EF6F26 /* FontGlyphs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontGlyphs.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                B2C3DA570D006CD600EF6F26 /* FontGlyphs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontGlyphs.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                B2C3DA560D006CD600EF6F26 /* FontCascadeFonts.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontCascadeFonts.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                B2C3DA570D006CD600EF6F26 /* FontCascadeFonts.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCascadeFonts.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontSelector.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPathSegCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20494,8 +20494,6 @@
</span><span class="cx">                                 B27535380B053814002CE64F /* Color.cpp */,
</span><span class="cx">                                 B27535390B053814002CE64F /* Color.h */,
</span><span class="cx">                                 9382DF5710A8D5C900925652 /* ColorSpace.h */,
</span><del>-                                B2C3DA4F0D006CD600EF6F26 /* FontCascade.cpp */,
-                                B2C3DA500D006CD600EF6F26 /* FontCascade.h */,
</del><span class="cx">                                 2D2FC0541460CD6F00263633 /* CrossfadeGeneratedImage.cpp */,
</span><span class="cx">                                 2D2FC0551460CD6F00263633 /* CrossfadeGeneratedImage.h */,
</span><span class="cx">                                 A8CB41020E85B8A50032C4F0 /* DashArray.h */,
</span><span class="lines">@@ -20524,14 +20522,16 @@
</span><span class="cx">                                 BCB92D4E1293550B00C8387F /* FontBaseline.h */,
</span><span class="cx">                                 B2C3DA510D006CD600EF6F26 /* FontCache.cpp */,
</span><span class="cx">                                 B2C3DA520D006CD600EF6F26 /* FontCache.h */,
</span><ins>+                                B2C3DA4F0D006CD600EF6F26 /* FontCascade.cpp */,
+                                B2C3DA500D006CD600EF6F26 /* FontCascade.h */,
+                                B2C3DA560D006CD600EF6F26 /* FontCascadeFonts.cpp */,
+                                B2C3DA570D006CD600EF6F26 /* FontCascadeFonts.h */,
</ins><span class="cx">                                 37ACCE620DA2AA960089E602 /* FontDescription.cpp */,
</span><span class="cx">                                 B2C3DA550D006CD600EF6F26 /* FontDescription.h */,
</span><span class="cx">                                 4A6E9FC513C17D570046A7F8 /* FontFeatureSettings.cpp */,
</span><span class="cx">                                 4A6E9FC613C17D570046A7F8 /* FontFeatureSettings.h */,
</span><span class="cx">                                 E44EE3A617576E5500EEE8CF /* FontGenericFamilies.cpp */,
</span><span class="cx">                                 E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */,
</span><del>-                                B2C3DA560D006CD600EF6F26 /* FontGlyphs.cpp */,
-                                B2C3DA570D006CD600EF6F26 /* FontGlyphs.h */,
</del><span class="cx">                                 0845680712B90DA600960A9F /* FontMetrics.h */,
</span><span class="cx">                                 F7A034C3126BF6BE007DC19E /* FontOrientation.h */,
</span><span class="cx">                                 84B62684133138F90095A489 /* FontPlatformData.cpp */,
</span><span class="lines">@@ -24416,7 +24416,7 @@
</span><span class="cx">                                 B2AFFC7E0D00A5C10030074D /* FontCustomPlatformData.h in Headers */,
</span><span class="cx">                                 B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */,
</span><span class="cx">                                 4A6E9FC813C17D570046A7F8 /* FontFeatureSettings.h in Headers */,
</span><del>-                                B2C3DA680D006CD600EF6F26 /* FontGlyphs.h in Headers */,
</del><ins>+                                B2C3DA680D006CD600EF6F26 /* FontCascadeFonts.h in Headers */,
</ins><span class="cx">                                 409EBDB616B7EEA300CBA3FC /* FontLoader.h in Headers */,
</span><span class="cx">                                 0845680812B90DA600960A9F /* FontMetrics.h in Headers */,
</span><span class="cx">                                 F7A034C4126BF6BE007DC19E /* FontOrientation.h in Headers */,
</span><span class="lines">@@ -27898,7 +27898,7 @@
</span><span class="cx">                                 37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */,
</span><span class="cx">                                 4A6E9FC713C17D570046A7F8 /* FontFeatureSettings.cpp in Sources */,
</span><span class="cx">                                 E44EE3A817577EBD00EEE8CF /* FontGenericFamilies.cpp in Sources */,
</span><del>-                                B2C3DA670D006CD600EF6F26 /* FontGlyphs.cpp in Sources */,
</del><ins>+                                B2C3DA670D006CD600EF6F26 /* FontCascadeFonts.cpp in Sources */,
</ins><span class="cx">                                 FD96C9971982FBDF0086E156 /* FontLoader.cpp in Sources */,
</span><span class="cx">                                 B2AFFC800D00A5C10030074D /* FontCascadeCocoa.mm in Sources */,
</span><span class="cx">                                 84B62685133138F90095A489 /* FontPlatformData.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/page/Settings.cpp        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void invalidateAfterGenericFamilyChange(Page* page)
</span><span class="cx"> {
</span><del>-    invalidateFontGlyphsCache();
</del><ins>+    invalidateFontCascadeCache();
</ins><span class="cx">     if (page)
</span><span class="cx">         page-&gt;setNeedsRecalcStyleInAllFrames();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.cpp        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FontCascade.h&quot;
</span><del>-#include &quot;FontGlyphs.h&quot;
</del><span class="cx"> #include &quot;FontPlatformData.h&quot;
</span><span class="cx"> #include &quot;FontSelector.h&quot;
</span><span class="cx"> #include &quot;MemoryPressureHandler.h&quot;
</span><span class="lines">@@ -426,7 +425,7 @@
</span><span class="cx"> 
</span><span class="cx"> void FontCache::purgeInactiveFontData(int purgeCount)
</span><span class="cx"> {
</span><del>-    pruneUnreferencedEntriesFromFontGlyphsCache();
</del><ins>+    pruneUnreferencedEntriesFromFontCascadeCache();
</ins><span class="cx">     pruneSystemFallbackFonts();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -535,7 +534,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     fontPlatformDataCache().clear();
</span><del>-    invalidateFontGlyphsCache();
</del><ins>+    invalidateFontCascadeCache();
</ins><span class="cx"> 
</span><span class="cx">     gGeneration++;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static Ref&lt;FontGlyphs&gt; retrieveOrAddCachedFontGlyphs(const FontDescription&amp;, PassRefPtr&lt;FontSelector&gt;);
</del><ins>+static Ref&lt;FontCascadeFonts&gt; retrieveOrAddCachedFonts(const FontDescription&amp;, PassRefPtr&lt;FontSelector&gt;);
</ins><span class="cx"> 
</span><span class="cx"> const uint8_t FontCascade::s_roundingHackCharacterTable[256] = {
</span><span class="cx">     0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
</span><span class="lines">@@ -125,8 +125,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: We should make this constructor platform-independent.
</span><del>-FontCascade::FontCascade(const FontPlatformData&amp; font, FontSmoothingMode fontSmoothingMode)
-    : m_glyphs(FontGlyphs::createForPlatformFont(font))
</del><ins>+FontCascade::FontCascade(const FontPlatformData&amp; fontData, FontSmoothingMode fontSmoothingMode)
+    : m_fonts(FontCascadeFonts::createForPlatformFont(fontData))
</ins><span class="cx">     , m_letterSpacing(0)
</span><span class="cx">     , m_wordSpacing(0)
</span><span class="cx">     , m_useBackslashAsYenSymbol(false)
</span><span class="lines">@@ -134,33 +134,32 @@
</span><span class="cx"> {
</span><span class="cx">     m_fontDescription.setFontSmoothing(fontSmoothingMode);
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    m_fontDescription.setSpecifiedSize(CTFontGetSize(font.font()));
-    m_fontDescription.setComputedSize(CTFontGetSize(font.font()));
-    m_fontDescription.setIsItalic(CTFontGetSymbolicTraits(font.font()) &amp; kCTFontTraitItalic);
-    m_fontDescription.setWeight((CTFontGetSymbolicTraits(font.font()) &amp; kCTFontTraitBold) ? FontWeightBold : FontWeightNormal);
</del><ins>+    m_fontDescription.setSpecifiedSize(CTFontGetSize(fontData.font()));
+    m_fontDescription.setComputedSize(CTFontGetSize(fontData.font()));
+    m_fontDescription.setIsItalic(CTFontGetSymbolicTraits(fontData.font()) &amp; kCTFontTraitItalic);
+    m_fontDescription.setWeight((CTFontGetSymbolicTraits(fontData.font()) &amp; kCTFontTraitBold) ? FontWeightBold : FontWeightNormal);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: We should make this constructor platform-independent.
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-FontCascade::FontCascade(const FontPlatformData&amp; font, PassRefPtr&lt;FontSelector&gt; fontSelector)
-    : m_glyphs(FontGlyphs::createForPlatformFont(font))
-    , m_letterSpacing(0)
</del><ins>+FontCascade::FontCascade(const FontPlatformData&amp; fontData, PassRefPtr&lt;FontSelector&gt; fontSelector)
+    : m_letterSpacing(0)
</ins><span class="cx">     , m_wordSpacing(0)
</span><span class="cx">     , m_typesettingFeatures(computeTypesettingFeatures())
</span><span class="cx"> {
</span><del>-    CTFontRef primaryFont = font.font();
</del><ins>+    CTFontRef primaryFont = fontData.font();
</ins><span class="cx">     m_fontDescription.setSpecifiedSize(CTFontGetSize(primaryFont));
</span><span class="cx">     m_fontDescription.setComputedSize(CTFontGetSize(primaryFont));
</span><span class="cx">     m_fontDescription.setIsItalic(CTFontGetSymbolicTraits(primaryFont) &amp; kCTFontTraitItalic);
</span><span class="cx">     m_fontDescription.setWeight((CTFontGetSymbolicTraits(primaryFont) &amp; kCTFontTraitBold) ? FontWeightBold : FontWeightNormal);
</span><del>-    m_glyphs = retrieveOrAddCachedFontGlyphs(m_fontDescription, fontSelector.get());
</del><ins>+    m_fonts = retrieveOrAddCachedFonts(m_fontDescription, fontSelector.get());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> FontCascade::FontCascade(const FontCascade&amp; other)
</span><span class="cx">     : m_fontDescription(other.m_fontDescription)
</span><del>-    , m_glyphs(other.m_glyphs)
</del><ins>+    , m_fonts(other.m_fonts)
</ins><span class="cx">     , m_letterSpacing(other.m_letterSpacing)
</span><span class="cx">     , m_wordSpacing(other.m_wordSpacing)
</span><span class="cx">     , m_useBackslashAsYenSymbol(other.m_useBackslashAsYenSymbol)
</span><span class="lines">@@ -171,7 +170,7 @@
</span><span class="cx"> FontCascade&amp; FontCascade::operator=(const FontCascade&amp; other)
</span><span class="cx"> {
</span><span class="cx">     m_fontDescription = other.m_fontDescription;
</span><del>-    m_glyphs = other.m_glyphs;
</del><ins>+    m_fonts = other.m_fonts;
</ins><span class="cx">     m_letterSpacing = other.m_letterSpacing;
</span><span class="cx">     m_wordSpacing = other.m_wordSpacing;
</span><span class="cx">     m_useBackslashAsYenSymbol = other.m_useBackslashAsYenSymbol;
</span><span class="lines">@@ -186,21 +185,21 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_fontDescription != other.m_fontDescription || m_letterSpacing != other.m_letterSpacing || m_wordSpacing != other.m_wordSpacing)
</span><span class="cx">         return false;
</span><del>-    if (m_glyphs == other.m_glyphs)
</del><ins>+    if (m_fonts == other.m_fonts)
</ins><span class="cx">         return true;
</span><del>-    if (!m_glyphs || !other.m_glyphs)
</del><ins>+    if (!m_fonts || !other.m_fonts)
</ins><span class="cx">         return false;
</span><del>-    if (m_glyphs-&gt;fontSelector() != other.m_glyphs-&gt;fontSelector())
</del><ins>+    if (m_fonts-&gt;fontSelector() != other.m_fonts-&gt;fontSelector())
</ins><span class="cx">         return false;
</span><span class="cx">     // Can these cases actually somehow occur? All fonts should get wiped out by full style recalc.
</span><del>-    if (m_glyphs-&gt;fontSelectorVersion() != other.m_glyphs-&gt;fontSelectorVersion())
</del><ins>+    if (m_fonts-&gt;fontSelectorVersion() != other.m_fonts-&gt;fontSelectorVersion())
</ins><span class="cx">         return false;
</span><del>-    if (m_glyphs-&gt;generation() != other.m_glyphs-&gt;generation())
</del><ins>+    if (m_fonts-&gt;generation() != other.m_fonts-&gt;generation())
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-struct FontGlyphsCacheKey {
</del><ins>+struct FontCascadeCacheKey {
</ins><span class="cx">     // This part of the key is shared with the lower level FontCache (caching FontData objects).
</span><span class="cx">     FontDescriptionFontDataCacheKey fontDescriptionCacheKey;
</span><span class="cx">     Vector&lt;AtomicString, 3&gt; families;
</span><span class="lines">@@ -209,20 +208,20 @@
</span><span class="cx">     unsigned fontSelectorFlags;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-struct FontGlyphsCacheEntry {
</del><ins>+struct FontCascadeCacheEntry {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    FontGlyphsCacheEntry(FontGlyphsCacheKey&amp;&amp; k, Ref&lt;FontGlyphs&gt;&amp;&amp; g)
-        : key(WTF::move(k))
-        , glyphs(WTF::move(g))
</del><ins>+    FontCascadeCacheEntry(FontCascadeCacheKey&amp;&amp; key, Ref&lt;FontCascadeFonts&gt;&amp;&amp; fonts)
+        : key(WTF::move(key))
+        , fonts(WTF::move(fonts))
</ins><span class="cx">     { }
</span><del>-    FontGlyphsCacheKey key;
-    Ref&lt;FontGlyphs&gt; glyphs;
</del><ins>+    FontCascadeCacheKey key;
+    Ref&lt;FontCascadeFonts&gt; fonts;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-typedef HashMap&lt;unsigned, std::unique_ptr&lt;FontGlyphsCacheEntry&gt;, AlreadyHashed&gt; FontGlyphsCache;
</del><ins>+typedef HashMap&lt;unsigned, std::unique_ptr&lt;FontCascadeCacheEntry&gt;, AlreadyHashed&gt; FontCascadeCache;
</ins><span class="cx"> 
</span><del>-static bool operator==(const FontGlyphsCacheKey&amp; a, const FontGlyphsCacheKey&amp; b)
</del><ins>+static bool operator==(const FontCascadeCacheKey&amp; a, const FontCascadeCacheKey&amp; b)
</ins><span class="cx"> {
</span><span class="cx">     if (a.fontDescriptionCacheKey != b.fontDescriptionCacheKey)
</span><span class="cx">         return false;
</span><span class="lines">@@ -237,21 +236,21 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static FontGlyphsCache&amp; fontGlyphsCache()
</del><ins>+static FontCascadeCache&amp; fontCascadeCache()
</ins><span class="cx"> {
</span><del>-    DEPRECATED_DEFINE_STATIC_LOCAL(FontGlyphsCache, cache, ());
</del><ins>+    DEPRECATED_DEFINE_STATIC_LOCAL(FontCascadeCache, cache, ());
</ins><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void invalidateFontGlyphsCache()
</del><ins>+void invalidateFontCascadeCache()
</ins><span class="cx"> {
</span><del>-    fontGlyphsCache().clear();
</del><ins>+    fontCascadeCache().clear();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void clearWidthCaches()
</span><span class="cx"> {
</span><del>-    for (auto it = fontGlyphsCache().begin(), end = fontGlyphsCache().end(); it != end; ++it)
-        it-&gt;value-&gt;glyphs.get().widthCache().clear();
</del><ins>+    for (auto&amp; value : fontCascadeCache().values())
+        value-&gt;fonts.get().widthCache().clear();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static unsigned makeFontSelectorFlags(const FontDescription&amp; description)
</span><span class="lines">@@ -259,17 +258,19 @@
</span><span class="cx">     return static_cast&lt;unsigned&gt;(description.script()) &lt;&lt; 1 | static_cast&lt;unsigned&gt;(description.smallCaps());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void makeFontGlyphsCacheKey(FontGlyphsCacheKey&amp; key, const FontDescription&amp; description, FontSelector* fontSelector)
</del><ins>+static FontCascadeCacheKey makeFontCascadeCacheKey(const FontDescription&amp; description, FontSelector* fontSelector)
</ins><span class="cx"> {
</span><ins>+    FontCascadeCacheKey key;
</ins><span class="cx">     key.fontDescriptionCacheKey = FontDescriptionFontDataCacheKey(description);
</span><span class="cx">     for (unsigned i = 0; i &lt; description.familyCount(); ++i)
</span><span class="cx">         key.families.append(description.familyAt(i));
</span><span class="cx">     key.fontSelectorId = fontSelector ? fontSelector-&gt;uniqueId() : 0;
</span><span class="cx">     key.fontSelectorVersion = fontSelector ? fontSelector-&gt;version() : 0;
</span><span class="cx">     key.fontSelectorFlags = fontSelector &amp;&amp; fontSelector-&gt;resolvesFamilyFor(description) ? makeFontSelectorFlags(description) : 0;
</span><ins>+    return key;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static unsigned computeFontGlyphsCacheHash(const FontGlyphsCacheKey&amp; key)
</del><ins>+static unsigned computeFontCascadeCacheHash(const FontCascadeCacheKey&amp; key)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;unsigned, 7&gt; hashCodes;
</span><span class="cx">     hashCodes.reserveInitialCapacity(4 + key.families.size());
</span><span class="lines">@@ -284,48 +285,47 @@
</span><span class="cx">     return StringHasher::hashMemory(hashCodes.data(), hashCodes.size() * sizeof(unsigned));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void pruneUnreferencedEntriesFromFontGlyphsCache()
</del><ins>+void pruneUnreferencedEntriesFromFontCascadeCache()
</ins><span class="cx"> {
</span><del>-    fontGlyphsCache().removeIf([](FontGlyphsCache::KeyValuePairType&amp; entry) {
-        return entry.value-&gt;glyphs.get().hasOneRef();
</del><ins>+    fontCascadeCache().removeIf([](FontCascadeCache::KeyValuePairType&amp; entry) {
+        return entry.value-&gt;fonts.get().hasOneRef();
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void pruneSystemFallbackFonts()
</span><span class="cx"> {
</span><del>-    for (auto&amp; entry : fontGlyphsCache().values())
-        entry-&gt;glyphs-&gt;pruneSystemFallbacks();
</del><ins>+    for (auto&amp; entry : fontCascadeCache().values())
+        entry-&gt;fonts-&gt;pruneSystemFallbacks();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Ref&lt;FontGlyphs&gt; retrieveOrAddCachedFontGlyphs(const FontDescription&amp; fontDescription, PassRefPtr&lt;FontSelector&gt; fontSelector)
</del><ins>+static Ref&lt;FontCascadeFonts&gt; retrieveOrAddCachedFonts(const FontDescription&amp; fontDescription, PassRefPtr&lt;FontSelector&gt; fontSelector)
</ins><span class="cx"> {
</span><del>-    FontGlyphsCacheKey key;
-    makeFontGlyphsCacheKey(key, fontDescription, fontSelector.get());
</del><ins>+    auto key = makeFontCascadeCacheKey(fontDescription, fontSelector.get());
</ins><span class="cx"> 
</span><del>-    unsigned hash = computeFontGlyphsCacheHash(key);
-    FontGlyphsCache::AddResult addResult = fontGlyphsCache().add(hash, std::unique_ptr&lt;FontGlyphsCacheEntry&gt;());
</del><ins>+    unsigned hash = computeFontCascadeCacheHash(key);
+    auto addResult = fontCascadeCache().add(hash, std::unique_ptr&lt;FontCascadeCacheEntry&gt;());
</ins><span class="cx">     if (!addResult.isNewEntry &amp;&amp; addResult.iterator-&gt;value-&gt;key == key)
</span><del>-        return addResult.iterator-&gt;value-&gt;glyphs.get();
</del><ins>+        return addResult.iterator-&gt;value-&gt;fonts.get();
</ins><span class="cx"> 
</span><del>-    std::unique_ptr&lt;FontGlyphsCacheEntry&gt;&amp; newEntry = addResult.iterator-&gt;value;
-    newEntry = std::make_unique&lt;FontGlyphsCacheEntry&gt;(WTF::move(key), FontGlyphs::create(fontSelector));
-    Ref&lt;FontGlyphs&gt; glyphs = newEntry-&gt;glyphs.get();
</del><ins>+    auto&amp; newEntry = addResult.iterator-&gt;value;
+    newEntry = std::make_unique&lt;FontCascadeCacheEntry&gt;(WTF::move(key), FontCascadeFonts::create(fontSelector));
+    Ref&lt;FontCascadeFonts&gt; glyphs = newEntry-&gt;fonts.get();
</ins><span class="cx"> 
</span><span class="cx">     static const unsigned unreferencedPruneInterval = 50;
</span><span class="cx">     static const int maximumEntries = 400;
</span><span class="cx">     static unsigned pruneCounter;
</span><del>-    // Referenced FontGlyphs would exist anyway so pruning them saves little memory.
</del><ins>+    // Referenced FontCascadeFonts would exist anyway so pruning them saves little memory.
</ins><span class="cx">     if (!(++pruneCounter % unreferencedPruneInterval))
</span><del>-        pruneUnreferencedEntriesFromFontGlyphsCache();
</del><ins>+        pruneUnreferencedEntriesFromFontCascadeCache();
</ins><span class="cx">     // Prevent pathological growth.
</span><del>-    if (fontGlyphsCache().size() &gt; maximumEntries)
-        fontGlyphsCache().remove(fontGlyphsCache().begin());
</del><ins>+    if (fontCascadeCache().size() &gt; maximumEntries)
+        fontCascadeCache().remove(fontCascadeCache().begin());
</ins><span class="cx">     return glyphs;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FontCascade::update(PassRefPtr&lt;FontSelector&gt; fontSelector) const
</span><span class="cx"> {
</span><del>-    m_glyphs = retrieveOrAddCachedFontGlyphs(m_fontDescription, fontSelector.get());
</del><ins>+    m_fonts = retrieveOrAddCachedFonts(m_fontDescription, fontSelector.get());
</ins><span class="cx">     m_useBackslashAsYenSymbol = useBackslashAsYenSignForFamily(firstFamily());
</span><span class="cx">     m_typesettingFeatures = computeTypesettingFeatures();
</span><span class="cx"> }
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasKerningOrLigatures = typesettingFeatures() &amp; (Kerning | Ligatures);
</span><span class="cx">     bool hasWordSpacingOrLetterSpacing = wordSpacing() || letterSpacing();
</span><del>-    float* cacheEntry = m_glyphs-&gt;widthCache().add(run, std::numeric_limits&lt;float&gt;::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
</del><ins>+    float* cacheEntry = m_fonts-&gt;widthCache().add(run, std::numeric_limits&lt;float&gt;::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
</ins><span class="cx">     if (cacheEntry &amp;&amp; !std::isnan(*cacheEntry))
</span><span class="cx">         return *cacheEntry;
</span><span class="cx"> 
</span><span class="lines">@@ -432,7 +432,7 @@
</span><span class="cx">     if (mirror)
</span><span class="cx">         c = u_charMirror(c);
</span><span class="cx"> 
</span><del>-    return m_glyphs-&gt;glyphDataForCharacter(c, m_fontDescription, variant);
</del><ins>+    return m_fonts-&gt;glyphDataForCharacter(c, m_fontDescription, variant);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="lines">@@ -1095,7 +1095,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool FontCascade::isLoadingCustomFonts() const
</span><span class="cx"> {
</span><del>-    return m_glyphs &amp;&amp; m_glyphs-&gt;isLoadingCustomFonts();
</del><ins>+    return m_fonts &amp;&amp; m_fonts-&gt;isLoadingCustomFonts();
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun&amp; textRun, const GlyphBuffer&amp; glyphBuffer, int index)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascade.h        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DashArray.h&quot;
</span><span class="cx"> #include &quot;Font.h&quot;
</span><ins>+#include &quot;FontCascadeFonts.h&quot;
</ins><span class="cx"> #include &quot;FontDescription.h&quot;
</span><del>-#include &quot;FontGlyphs.h&quot;
</del><span class="cx"> #include &quot;Path.h&quot;
</span><span class="cx"> #include &quot;TextDirection.h&quot;
</span><span class="cx"> #include &quot;TypesettingFeatures.h&quot;
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx">     FontWeight weight() const { return m_fontDescription.weight(); }
</span><span class="cx">     FontWidthVariant widthVariant() const { return m_fontDescription.widthVariant(); }
</span><span class="cx"> 
</span><del>-    bool isPlatformFont() const { return m_glyphs-&gt;isForPlatformFont(); }
</del><ins>+    bool isPlatformFont() const { return m_fonts-&gt;isForPlatformFont(); }
</ins><span class="cx"> 
</span><span class="cx">     const FontMetrics&amp; fontMetrics() const { return primaryFont().fontMetrics(); }
</span><span class="cx">     float spaceWidth() const { return primaryFont().spaceWidth() + m_letterSpacing; }
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">     static String normalizeSpaces(const UChar*, unsigned length);
</span><span class="cx"> 
</span><span class="cx">     bool useBackslashAsYenSymbol() const { return m_useBackslashAsYenSymbol; }
</span><del>-    FontGlyphs* glyphs() const { return m_glyphs.get(); }
</del><ins>+    FontCascadeFonts* fonts() const { return m_fonts.get(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isLoadingCustomFonts() const;
</span><span class="lines">@@ -335,15 +335,15 @@
</span><span class="cx">     static TypesettingFeatures s_defaultTypesettingFeatures;
</span><span class="cx"> 
</span><span class="cx">     FontDescription m_fontDescription;
</span><del>-    mutable RefPtr&lt;FontGlyphs&gt; m_glyphs;
</del><ins>+    mutable RefPtr&lt;FontCascadeFonts&gt; m_fonts;
</ins><span class="cx">     float m_letterSpacing;
</span><span class="cx">     float m_wordSpacing;
</span><span class="cx">     mutable bool m_useBackslashAsYenSymbol;
</span><span class="cx">     mutable unsigned m_typesettingFeatures : 2; // (TypesettingFeatures) Caches values computed from m_fontDescription.
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-void invalidateFontGlyphsCache();
-void pruneUnreferencedEntriesFromFontGlyphsCache();
</del><ins>+void invalidateFontCascadeCache();
+void pruneUnreferencedEntriesFromFontCascadeCache();
</ins><span class="cx"> void pruneSystemFallbackFonts();
</span><span class="cx"> void clearWidthCaches();
</span><span class="cx"> 
</span><span class="lines">@@ -353,25 +353,25 @@
</span><span class="cx"> 
</span><span class="cx"> inline const Font&amp; FontCascade::primaryFont() const
</span><span class="cx"> {
</span><del>-    ASSERT(m_glyphs);
-    return m_glyphs-&gt;primaryFont(m_fontDescription);
</del><ins>+    ASSERT(m_fonts);
+    return m_fonts-&gt;primaryFont(m_fontDescription);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline const FontRanges&amp; FontCascade::fallbackRangesAt(unsigned index) const
</span><span class="cx"> {
</span><del>-    ASSERT(m_glyphs);
-    return m_glyphs-&gt;realizeFallbackRangesAt(m_fontDescription, index);
</del><ins>+    ASSERT(m_fonts);
+    return m_fonts-&gt;realizeFallbackRangesAt(m_fontDescription, index);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline bool FontCascade::isFixedPitch() const
</span><span class="cx"> {
</span><del>-    ASSERT(m_glyphs);
-    return m_glyphs-&gt;isFixedPitch(m_fontDescription);
</del><ins>+    ASSERT(m_fonts);
+    return m_fonts-&gt;isFixedPitch(m_fontDescription);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline FontSelector* FontCascade::fontSelector() const
</span><span class="cx"> {
</span><del>-    return m_glyphs ? m_glyphs-&gt;fontSelector() : 0;
</del><ins>+    return m_fonts ? m_fonts-&gt;fontSelector() : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline float FontCascade::tabWidth(const Font&amp; font, unsigned tabSize, float position) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadeFontscppfromrev180293trunkSourceWebCoreplatformgraphicsFontGlyphscpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (from rev 180293, trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp) (0 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -0,0 +1,408 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2013-2015 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;FontCascadeFonts.h&quot;
+
+#include &quot;FontCache.h&quot;
+#include &quot;FontCascade.h&quot;
+#include &quot;GlyphPage.h&quot;
+
+namespace WebCore {
+
+
+FontCascadeFonts::FontCascadeFonts(PassRefPtr&lt;FontSelector&gt; fontSelector)
+    : m_cachedPrimaryFont(nullptr)
+    , m_fontSelector(fontSelector)
+    , m_fontSelectorVersion(m_fontSelector ? m_fontSelector-&gt;version() : 0)
+    , m_generation(FontCache::singleton().generation())
+{
+}
+
+FontCascadeFonts::FontCascadeFonts(const FontPlatformData&amp; platformData)
+    : m_cachedPrimaryFont(nullptr)
+    , m_fontSelectorVersion(0)
+    , m_generation(FontCache::singleton().generation())
+    , m_isForPlatformFont(true)
+{
+    m_realizedFallbackRanges.append(FontRanges(FontCache::singleton().fontForPlatformData(platformData)));
+}
+
+FontCascadeFonts::~FontCascadeFonts()
+{
+}
+
+void FontCascadeFonts::determinePitch(const FontDescription&amp; description)
+{
+    auto&amp; primaryRanges = realizeFallbackRangesAt(description, 0);
+    unsigned numRanges = primaryRanges.size();
+    if (numRanges == 1)
+        m_pitch = primaryRanges.rangeAt(0).font().pitch();
+    else
+        m_pitch = VariablePitch;
+}
+
+bool FontCascadeFonts::isLoadingCustomFonts() const
+{
+    for (auto&amp; fontRanges : m_realizedFallbackRanges) {
+        if (fontRanges.isLoading())
+            return true;
+    }
+    return false;
+}
+
+static FontRanges realizeNextFallback(const FontDescription&amp; description, unsigned&amp; index, FontSelector* fontSelector)
+{
+    ASSERT(index &lt; description.familyCount());
+
+    auto&amp; fontCache = FontCache::singleton();
+    while (index &lt; description.familyCount()) {
+        const AtomicString&amp; family = description.familyAt(index++);
+        if (family.isEmpty())
+            continue;
+        if (fontSelector) {
+            auto ranges = fontSelector-&gt;fontRangesForFamily(description, family);
+            if (!ranges.isNull())
+                return ranges;
+        }
+        if (auto font = fontCache.fontForFamily(description, family))
+            return FontRanges(WTF::move(font));
+    }
+    // We didn't find a font. Try to find a similar font using our own specific knowledge about our platform.
+    // For example on OS X, we know to map any families containing the words Arabic, Pashto, or Urdu to the
+    // Geeza Pro font.
+    return FontRanges(fontCache.similarFont(description));
+}
+
+const FontRanges&amp; FontCascadeFonts::realizeFallbackRangesAt(const FontDescription&amp; description, unsigned index)
+{
+    if (index &lt; m_realizedFallbackRanges.size())
+        return m_realizedFallbackRanges[index];
+
+    ASSERT(index == m_realizedFallbackRanges.size());
+    ASSERT(FontCache::singleton().generation() == m_generation);
+
+    m_realizedFallbackRanges.append(FontRanges());
+    auto&amp; fontRanges = m_realizedFallbackRanges.last();
+
+    if (!index) {
+        fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
+        if (fontRanges.isNull() &amp;&amp; m_fontSelector)
+            fontRanges = m_fontSelector-&gt;fontRangesForFamily(description, standardFamily);
+        if (fontRanges.isNull())
+            fontRanges = FontRanges(FontCache::singleton().lastResortFallbackFont(description));
+        return fontRanges;
+    }
+
+    if (m_lastRealizedFallbackIndex &lt; description.familyCount())
+        fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
+
+    if (fontRanges.isNull() &amp;&amp; m_fontSelector) {
+        ASSERT(m_lastRealizedFallbackIndex &gt;= description.familyCount());
+
+        unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.familyCount();
+        if (fontSelectorFallbackIndex == m_fontSelector-&gt;fallbackFontCount())
+            return fontRanges;
+        ++m_lastRealizedFallbackIndex;
+        fontRanges = FontRanges(m_fontSelector-&gt;fallbackFontAt(description, fontSelectorFallbackIndex));
+    }
+
+    return fontRanges;
+}
+
+static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
+{
+    return character &gt;= lowerBound &amp;&amp; character &lt;= upperBound;
+}
+
+static bool shouldIgnoreRotation(UChar32 character)
+{
+    if (character == 0x000A7 || character == 0x000A9 || character == 0x000AE)
+        return true;
+
+    if (character == 0x000B6 || character == 0x000BC || character == 0x000BD || character == 0x000BE)
+        return true;
+
+    if (isInRange(character, 0x002E5, 0x002EB))
+        return true;
+    
+    if (isInRange(character, 0x01100, 0x011FF) || isInRange(character, 0x01401, 0x0167F) || isInRange(character, 0x01800, 0x018FF))
+        return true;
+
+    if (character == 0x02016 || character == 0x02020 || character == 0x02021 || character == 0x2030 || character == 0x02031)
+        return true;
+
+    if (isInRange(character, 0x0203B, 0x0203D) || character == 0x02042 || character == 0x02044 || character == 0x02047
+        || character == 0x02048 || character == 0x02049 || character == 0x2051)
+        return true;
+
+    if (isInRange(character, 0x02065, 0x02069) || isInRange(character, 0x020DD, 0x020E0)
+        || isInRange(character, 0x020E2, 0x020E4) || isInRange(character, 0x02100, 0x02117)
+        || isInRange(character, 0x02119, 0x02131) || isInRange(character, 0x02133, 0x0213F))
+        return true;
+
+    if (isInRange(character, 0x02145, 0x0214A) || character == 0x0214C || character == 0x0214D
+        || isInRange(character, 0x0214F, 0x0218F))
+        return true;
+
+    if (isInRange(character, 0x02300, 0x02307) || isInRange(character, 0x0230C, 0x0231F)
+        || isInRange(character, 0x02322, 0x0232B) || isInRange(character, 0x0237D, 0x0239A)
+        || isInRange(character, 0x023B4, 0x023B6) || isInRange(character, 0x023BA, 0x023CF)
+        || isInRange(character, 0x023D1, 0x023DB) || isInRange(character, 0x023E2, 0x024FF))
+        return true;
+
+    if (isInRange(character, 0x025A0, 0x02619) || isInRange(character, 0x02620, 0x02767)
+        || isInRange(character, 0x02776, 0x02793) || isInRange(character, 0x02B12, 0x02B2F)
+        || isInRange(character, 0x02B4D, 0x02BFF) || isInRange(character, 0x02E80, 0x03007))
+        return true;
+
+    if (character == 0x03012 || character == 0x03013 || isInRange(character, 0x03020, 0x0302F)
+        || isInRange(character, 0x03031, 0x0309F) || isInRange(character, 0x030A1, 0x030FB)
+        || isInRange(character, 0x030FD, 0x0A4CF))
+        return true;
+
+    if (isInRange(character, 0x0A840, 0x0A87F) || isInRange(character, 0x0A960, 0x0A97F)
+        || isInRange(character, 0x0AC00, 0x0D7FF) || isInRange(character, 0x0E000, 0x0FAFF))
+        return true;
+
+    if (isInRange(character, 0x0FE10, 0x0FE1F) || isInRange(character, 0x0FE30, 0x0FE48)
+        || isInRange(character, 0x0FE50, 0x0FE57) || isInRange(character, 0x0FE5F, 0x0FE62)
+        || isInRange(character, 0x0FE67, 0x0FE6F))
+        return true;
+
+    if (isInRange(character, 0x0FF01, 0x0FF07) || isInRange(character, 0x0FF0A, 0x0FF0C)
+        || isInRange(character, 0x0FF0E, 0x0FF19) || character == 0x0FF1B || isInRange(character, 0x0FF1F, 0x0FF3A))
+        return true;
+
+    if (character == 0x0FF3C || character == 0x0FF3E)
+        return true;
+
+    if (isInRange(character, 0x0FF40, 0x0FF5A) || isInRange(character, 0x0FFE0, 0x0FFE2)
+        || isInRange(character, 0x0FFE4, 0x0FFE7) || isInRange(character, 0x0FFF0, 0x0FFF8)
+        || character == 0x0FFFD)
+        return true;
+
+    if (isInRange(character, 0x13000, 0x1342F) || isInRange(character, 0x1B000, 0x1B0FF)
+        || isInRange(character, 0x1D000, 0x1D1FF) || isInRange(character, 0x1D300, 0x1D37F)
+        || isInRange(character, 0x1F000, 0x1F64F) || isInRange(character, 0x1F680, 0x1F77F))
+        return true;
+    
+    if (isInRange(character, 0x20000, 0x2FFFD) || isInRange(character, 0x30000, 0x3FFFD))
+        return true;
+
+    return false;
+}
+
+#if PLATFORM(COCOA)
+static GlyphData glyphDataForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData&amp; data)
+{
+    GlyphData nonItalicData = data.font-&gt;nonSyntheticItalicFont()-&gt;glyphDataForCharacter(character);
+    if (nonItalicData.font)
+        return nonItalicData;
+    return data;
+}
+#endif
+    
+static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, const GlyphData&amp; data)
+{
+    if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
+        GlyphData uprightData = data.font-&gt;uprightOrientationFont()-&gt;glyphDataForCharacter(character);
+        // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
+        if (data.glyph == uprightData.glyph)
+            return data;
+        // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
+        // glyph, so we fall back to the upright data and use the horizontal glyph.
+        if (uprightData.font)
+            return uprightData;
+    } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
+        GlyphData verticalRightData = data.font-&gt;verticalRightOrientationFont()-&gt;glyphDataForCharacter(character);
+        // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
+        // into it.
+        if (data.glyph != verticalRightData.glyph)
+            return data;
+        // The glyphs are identical, meaning that we should just use the horizontal glyph.
+        if (verticalRightData.font)
+            return verticalRightData;
+    }
+    return data;
+}
+
+GlyphData FontCascadeFonts::glyphDataForSystemFallback(UChar32 c, const FontDescription&amp; description, FontVariant variant)
+{
+    // System fallback is character-dependent.
+    auto&amp; primaryRanges = realizeFallbackRangesAt(description, 0);
+    auto* originalFont = primaryRanges.fontForCharacter(c);
+    if (!originalFont)
+        originalFont = &amp;primaryRanges.fontForFirstRange();
+
+    RefPtr&lt;Font&gt; systemFallbackFont = originalFont-&gt;systemFallbackFontForCharacter(c, description, m_isForPlatformFont);
+    if (!systemFallbackFont)
+        return GlyphData();
+
+    if (systemFallbackFont-&gt;platformData().orientation() == Vertical &amp;&amp; !systemFallbackFont-&gt;hasVerticalGlyphs() &amp;&amp; FontCascade::isCJKIdeographOrSymbol(c))
+        variant = BrokenIdeographVariant;
+
+    GlyphData fallbackGlyphData;
+    if (variant == NormalVariant)
+        fallbackGlyphData = systemFallbackFont-&gt;glyphDataForCharacter(c);
+    else
+        fallbackGlyphData = systemFallbackFont-&gt;variantFont(description, variant)-&gt;glyphDataForCharacter(c);
+
+    if (variant == NormalVariant &amp;&amp; fallbackGlyphData.font) {
+        if (!FontCascade::isCJKIdeographOrSymbol(c) &amp;&amp; fallbackGlyphData.font-&gt;platformData().orientation() == Vertical &amp;&amp; !fallbackGlyphData.font-&gt;isTextOrientationFallback())
+            fallbackGlyphData = glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), fallbackGlyphData);
+    }
+
+    // Keep the system fallback fonts we use alive.
+    if (fallbackGlyphData.glyph)
+        m_systemFallbackFontSet.add(systemFallbackFont.release());
+
+    return fallbackGlyphData;
+}
+
+GlyphData FontCascadeFonts::glyphDataForVariant(UChar32 c, const FontDescription&amp; description, FontVariant variant, unsigned fallbackIndex)
+{
+    while (true) {
+        auto&amp; fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
+        if (fontRanges.isNull())
+            break;
+        auto* font = fontRanges.fontForCharacter(c);
+        GlyphData data = font ? font-&gt;glyphDataForCharacter(c) : GlyphData();
+        if (data.font) {
+            // The variantFont function should not normally return 0.
+            // But if it does, we will just render the capital letter big.
+            RefPtr&lt;Font&gt; variantFont = data.font-&gt;variantFont(description, variant);
+            if (!variantFont)
+                return data;
+
+            return variantFont-&gt;glyphDataForCharacter(c);
+        }
+    }
+
+    return glyphDataForSystemFallback(c, description, variant);
+}
+
+GlyphData FontCascadeFonts::glyphDataForNormalVariant(UChar32 c, const FontDescription&amp; description)
+{
+    const unsigned pageNumber = c / GlyphPage::size;
+
+    for (unsigned fallbackIndex = 0; true; ++fallbackIndex) {
+        auto&amp; fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
+        if (fontRanges.isNull())
+            break;
+        auto* font = fontRanges.fontForCharacter(c);
+        auto* page = font ? font-&gt;glyphPage(pageNumber) : nullptr;
+        if (!page)
+            continue;
+        GlyphData data = page-&gt;glyphDataForCharacter(c);
+        if (data.font) {
+            if (data.font-&gt;platformData().orientation() == Vertical &amp;&amp; !data.font-&gt;isTextOrientationFallback()) {
+                if (!FontCascade::isCJKIdeographOrSymbol(c))
+                    return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data);
+
+                if (!data.font-&gt;hasVerticalGlyphs()) {
+                    // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
+                    // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
+                    return glyphDataForVariant(c, description, BrokenIdeographVariant, fallbackIndex);
+                }
+#if PLATFORM(COCOA)
+                if (data.font-&gt;platformData().syntheticOblique())
+                    return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data);
+#endif
+            }
+
+            return data;
+        }
+    }
+
+    return glyphDataForSystemFallback(c, description, NormalVariant);
+}
+
+static RefPtr&lt;GlyphPage&gt; glyphPageFromFontRanges(unsigned pageNumber, const FontRanges&amp; fontRanges)
+{
+    const Font* font = nullptr;
+    UChar32 pageRangeFrom = pageNumber * GlyphPage::size;
+    UChar32 pageRangeTo = pageRangeFrom + GlyphPage::size - 1;
+    for (unsigned i = 0; i &lt; fontRanges.size(); ++i) {
+        auto&amp; range = fontRanges.rangeAt(i);
+        if (range.to()) {
+            if (range.from() &lt;= pageRangeFrom &amp;&amp; pageRangeTo &lt;= range.to())
+                font = &amp;range.font();
+            break;
+        }
+    }
+    if (!font)
+        return nullptr;
+
+    if (font-&gt;platformData().orientation() == Vertical)
+        return nullptr;
+
+    return const_cast&lt;GlyphPage*&gt;(font-&gt;glyphPage(pageNumber));
+}
+
+GlyphData FontCascadeFonts::glyphDataForCharacter(UChar32 c, const FontDescription&amp; description, FontVariant variant)
+{
+    ASSERT(isMainThread());
+    ASSERT(variant != AutoVariant);
+
+    if (variant != NormalVariant)
+        return glyphDataForVariant(c, description, variant, 0);
+
+    const unsigned pageNumber = c / GlyphPage::size;
+
+    RefPtr&lt;GlyphPage&gt;&amp; cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator-&gt;value : m_cachedPageZero;
+    if (!cachedPage)
+        cachedPage = glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0));
+
+    GlyphData glyphData = cachedPage ? cachedPage-&gt;glyphDataForCharacter(c) : GlyphData();
+    if (!glyphData.glyph) {
+        if (!cachedPage)
+            cachedPage = GlyphPage::createForMixedFonts();
+        else if (cachedPage-&gt;isImmutable())
+            cachedPage = GlyphPage::createCopyForMixedFonts(*cachedPage);
+
+        glyphData = glyphDataForNormalVariant(c, description);
+        cachedPage-&gt;setGlyphDataForCharacter(c, glyphData.glyph, glyphData.font);
+    }
+    return glyphData;
+}
+
+void FontCascadeFonts::pruneSystemFallbacks()
+{
+    if (m_systemFallbackFontSet.isEmpty())
+        return;
+    // Mutable glyph pages may reference fallback fonts.
+    if (m_cachedPageZero &amp;&amp; !m_cachedPageZero-&gt;isImmutable())
+        m_cachedPageZero = nullptr;
+    m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType&amp; keyAndValue) {
+        return !keyAndValue.value-&gt;isImmutable();
+    });
+    m_systemFallbackFontSet.clear();
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadeFontshfromrev180293trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h (from rev 180293, trunk/Source/WebCore/platform/graphics/FontGlyphs.h) (0 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2010, 2013-2015 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FontCascadeFonts_h
+#define FontCascadeFonts_h
+
+#include &quot;Font.h&quot;
+#include &quot;FontRanges.h&quot;
+#include &quot;FontSelector.h&quot;
+#include &quot;GlyphPage.h&quot;
+#include &quot;WidthCache.h&quot;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/MainThread.h&gt;
+
+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
+namespace WebCore {
+
+class GraphicsContext;
+class IntRect;
+class FontDescription;
+class FontPlatformData;
+class FontSelector;
+
+class FontCascadeFonts : public RefCounted&lt;FontCascadeFonts&gt; {
+    WTF_MAKE_NONCOPYABLE(FontCascadeFonts);
+public:
+    static Ref&lt;FontCascadeFonts&gt; create(PassRefPtr&lt;FontSelector&gt; fontSelector) { return adoptRef(*new FontCascadeFonts(fontSelector)); }
+    static Ref&lt;FontCascadeFonts&gt; createForPlatformFont(const FontPlatformData&amp; platformData) { return adoptRef(*new FontCascadeFonts(platformData)); }
+
+    WEBCORE_EXPORT ~FontCascadeFonts();
+
+    bool isForPlatformFont() const { return m_isForPlatformFont; }
+
+    GlyphData glyphDataForCharacter(UChar32, const FontDescription&amp;, FontVariant);
+
+    bool isFixedPitch(const FontDescription&amp;);
+    void determinePitch(const FontDescription&amp;);
+
+    bool isLoadingCustomFonts() const;
+
+    FontSelector* fontSelector() { return m_fontSelector.get(); }
+    // FIXME: It should be possible to combine fontSelectorVersion and generation.
+    unsigned fontSelectorVersion() const { return m_fontSelectorVersion; }
+    unsigned generation() const { return m_generation; }
+
+    WidthCache&amp; widthCache() { return m_widthCache; }
+    const WidthCache&amp; widthCache() const { return m_widthCache; }
+
+    const Font&amp; primaryFont(const FontDescription&amp;);
+    WEBCORE_EXPORT const FontRanges&amp; realizeFallbackRangesAt(const FontDescription&amp;, unsigned fallbackIndex);
+
+    void pruneSystemFallbacks();
+
+private:
+    FontCascadeFonts(PassRefPtr&lt;FontSelector&gt;);
+    FontCascadeFonts(const FontPlatformData&amp;);
+
+    GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&amp;, FontVariant);
+    GlyphData glyphDataForNormalVariant(UChar32, const FontDescription&amp;);
+    GlyphData glyphDataForVariant(UChar32, const FontDescription&amp;, FontVariant, unsigned fallbackIndex);
+
+    Vector&lt;FontRanges, 1&gt; m_realizedFallbackRanges;
+    unsigned m_lastRealizedFallbackIndex { 0 };
+
+    RefPtr&lt;GlyphPage&gt; m_cachedPageZero;
+    HashMap&lt;int, RefPtr&lt;GlyphPage&gt;&gt; m_cachedPages;
+
+    HashSet&lt;RefPtr&lt;Font&gt;&gt; m_systemFallbackFontSet;
+
+    const Font* m_cachedPrimaryFont;
+    RefPtr&lt;FontSelector&gt; m_fontSelector;
+
+    WidthCache m_widthCache;
+
+    unsigned m_fontSelectorVersion;
+    unsigned short m_generation;
+    Pitch m_pitch { UnknownPitch };
+    bool m_isForPlatformFont { false };
+};
+
+inline bool FontCascadeFonts::isFixedPitch(const FontDescription&amp; description)
+{
+    if (m_pitch == UnknownPitch)
+        determinePitch(description);
+    return m_pitch == FixedPitch;
+};
+
+inline const Font&amp; FontCascadeFonts::primaryFont(const FontDescription&amp; description)
+{
+    ASSERT(isMainThread());
+    if (!m_cachedPrimaryFont) {
+        auto&amp; primaryRanges = realizeFallbackRangesAt(description, 0);
+        m_cachedPrimaryFont = primaryRanges.fontForCharacter(' ');
+        if (!m_cachedPrimaryFont)
+            m_cachedPrimaryFont = &amp;primaryRanges.fontForFirstRange();
+    }
+    return *m_cachedPrimaryFont;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphscpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -1,408 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2013-2015 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;FontGlyphs.h&quot;
-
-#include &quot;FontCache.h&quot;
-#include &quot;FontCascade.h&quot;
-#include &quot;GlyphPage.h&quot;
-
-namespace WebCore {
-
-
-FontGlyphs::FontGlyphs(PassRefPtr&lt;FontSelector&gt; fontSelector)
-    : m_cachedPrimaryFont(nullptr)
-    , m_fontSelector(fontSelector)
-    , m_fontSelectorVersion(m_fontSelector ? m_fontSelector-&gt;version() : 0)
-    , m_generation(FontCache::singleton().generation())
-{
-}
-
-FontGlyphs::FontGlyphs(const FontPlatformData&amp; platformData)
-    : m_cachedPrimaryFont(nullptr)
-    , m_fontSelectorVersion(0)
-    , m_generation(FontCache::singleton().generation())
-    , m_isForPlatformFont(true)
-{
-    m_realizedFallbackRanges.append(FontRanges(FontCache::singleton().fontForPlatformData(platformData)));
-}
-
-FontGlyphs::~FontGlyphs()
-{
-}
-
-void FontGlyphs::determinePitch(const FontDescription&amp; description)
-{
-    auto&amp; primaryRanges = realizeFallbackRangesAt(description, 0);
-    unsigned numRanges = primaryRanges.size();
-    if (numRanges == 1)
-        m_pitch = primaryRanges.rangeAt(0).font().pitch();
-    else
-        m_pitch = VariablePitch;
-}
-
-bool FontGlyphs::isLoadingCustomFonts() const
-{
-    for (auto&amp; fontRanges : m_realizedFallbackRanges) {
-        if (fontRanges.isLoading())
-            return true;
-    }
-    return false;
-}
-
-static FontRanges realizeNextFallback(const FontDescription&amp; description, unsigned&amp; index, FontSelector* fontSelector)
-{
-    ASSERT(index &lt; description.familyCount());
-
-    auto&amp; fontCache = FontCache::singleton();
-    while (index &lt; description.familyCount()) {
-        const AtomicString&amp; family = description.familyAt(index++);
-        if (family.isEmpty())
-            continue;
-        if (fontSelector) {
-            auto ranges = fontSelector-&gt;fontRangesForFamily(description, family);
-            if (!ranges.isNull())
-                return ranges;
-        }
-        if (auto font = fontCache.fontForFamily(description, family))
-            return FontRanges(WTF::move(font));
-    }
-    // We didn't find a font. Try to find a similar font using our own specific knowledge about our platform.
-    // For example on OS X, we know to map any families containing the words Arabic, Pashto, or Urdu to the
-    // Geeza Pro font.
-    return FontRanges(fontCache.similarFont(description));
-}
-
-const FontRanges&amp; FontGlyphs::realizeFallbackRangesAt(const FontDescription&amp; description, unsigned index)
-{
-    if (index &lt; m_realizedFallbackRanges.size())
-        return m_realizedFallbackRanges[index];
-
-    ASSERT(index == m_realizedFallbackRanges.size());
-    ASSERT(FontCache::singleton().generation() == m_generation);
-
-    m_realizedFallbackRanges.append(FontRanges());
-    auto&amp; fontRanges = m_realizedFallbackRanges.last();
-
-    if (!index) {
-        fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
-        if (fontRanges.isNull() &amp;&amp; m_fontSelector)
-            fontRanges = m_fontSelector-&gt;fontRangesForFamily(description, standardFamily);
-        if (fontRanges.isNull())
-            fontRanges = FontRanges(FontCache::singleton().lastResortFallbackFont(description));
-        return fontRanges;
-    }
-
-    if (m_lastRealizedFallbackIndex &lt; description.familyCount())
-        fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
-
-    if (fontRanges.isNull() &amp;&amp; m_fontSelector) {
-        ASSERT(m_lastRealizedFallbackIndex &gt;= description.familyCount());
-
-        unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.familyCount();
-        if (fontSelectorFallbackIndex == m_fontSelector-&gt;fallbackFontCount())
-            return fontRanges;
-        ++m_lastRealizedFallbackIndex;
-        fontRanges = FontRanges(m_fontSelector-&gt;fallbackFontAt(description, fontSelectorFallbackIndex));
-    }
-
-    return fontRanges;
-}
-
-static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
-{
-    return character &gt;= lowerBound &amp;&amp; character &lt;= upperBound;
-}
-
-static bool shouldIgnoreRotation(UChar32 character)
-{
-    if (character == 0x000A7 || character == 0x000A9 || character == 0x000AE)
-        return true;
-
-    if (character == 0x000B6 || character == 0x000BC || character == 0x000BD || character == 0x000BE)
-        return true;
-
-    if (isInRange(character, 0x002E5, 0x002EB))
-        return true;
-    
-    if (isInRange(character, 0x01100, 0x011FF) || isInRange(character, 0x01401, 0x0167F) || isInRange(character, 0x01800, 0x018FF))
-        return true;
-
-    if (character == 0x02016 || character == 0x02020 || character == 0x02021 || character == 0x2030 || character == 0x02031)
-        return true;
-
-    if (isInRange(character, 0x0203B, 0x0203D) || character == 0x02042 || character == 0x02044 || character == 0x02047
-        || character == 0x02048 || character == 0x02049 || character == 0x2051)
-        return true;
-
-    if (isInRange(character, 0x02065, 0x02069) || isInRange(character, 0x020DD, 0x020E0)
-        || isInRange(character, 0x020E2, 0x020E4) || isInRange(character, 0x02100, 0x02117)
-        || isInRange(character, 0x02119, 0x02131) || isInRange(character, 0x02133, 0x0213F))
-        return true;
-
-    if (isInRange(character, 0x02145, 0x0214A) || character == 0x0214C || character == 0x0214D
-        || isInRange(character, 0x0214F, 0x0218F))
-        return true;
-
-    if (isInRange(character, 0x02300, 0x02307) || isInRange(character, 0x0230C, 0x0231F)
-        || isInRange(character, 0x02322, 0x0232B) || isInRange(character, 0x0237D, 0x0239A)
-        || isInRange(character, 0x023B4, 0x023B6) || isInRange(character, 0x023BA, 0x023CF)
-        || isInRange(character, 0x023D1, 0x023DB) || isInRange(character, 0x023E2, 0x024FF))
-        return true;
-
-    if (isInRange(character, 0x025A0, 0x02619) || isInRange(character, 0x02620, 0x02767)
-        || isInRange(character, 0x02776, 0x02793) || isInRange(character, 0x02B12, 0x02B2F)
-        || isInRange(character, 0x02B4D, 0x02BFF) || isInRange(character, 0x02E80, 0x03007))
-        return true;
-
-    if (character == 0x03012 || character == 0x03013 || isInRange(character, 0x03020, 0x0302F)
-        || isInRange(character, 0x03031, 0x0309F) || isInRange(character, 0x030A1, 0x030FB)
-        || isInRange(character, 0x030FD, 0x0A4CF))
-        return true;
-
-    if (isInRange(character, 0x0A840, 0x0A87F) || isInRange(character, 0x0A960, 0x0A97F)
-        || isInRange(character, 0x0AC00, 0x0D7FF) || isInRange(character, 0x0E000, 0x0FAFF))
-        return true;
-
-    if (isInRange(character, 0x0FE10, 0x0FE1F) || isInRange(character, 0x0FE30, 0x0FE48)
-        || isInRange(character, 0x0FE50, 0x0FE57) || isInRange(character, 0x0FE5F, 0x0FE62)
-        || isInRange(character, 0x0FE67, 0x0FE6F))
-        return true;
-
-    if (isInRange(character, 0x0FF01, 0x0FF07) || isInRange(character, 0x0FF0A, 0x0FF0C)
-        || isInRange(character, 0x0FF0E, 0x0FF19) || character == 0x0FF1B || isInRange(character, 0x0FF1F, 0x0FF3A))
-        return true;
-
-    if (character == 0x0FF3C || character == 0x0FF3E)
-        return true;
-
-    if (isInRange(character, 0x0FF40, 0x0FF5A) || isInRange(character, 0x0FFE0, 0x0FFE2)
-        || isInRange(character, 0x0FFE4, 0x0FFE7) || isInRange(character, 0x0FFF0, 0x0FFF8)
-        || character == 0x0FFFD)
-        return true;
-
-    if (isInRange(character, 0x13000, 0x1342F) || isInRange(character, 0x1B000, 0x1B0FF)
-        || isInRange(character, 0x1D000, 0x1D1FF) || isInRange(character, 0x1D300, 0x1D37F)
-        || isInRange(character, 0x1F000, 0x1F64F) || isInRange(character, 0x1F680, 0x1F77F))
-        return true;
-    
-    if (isInRange(character, 0x20000, 0x2FFFD) || isInRange(character, 0x30000, 0x3FFFD))
-        return true;
-
-    return false;
-}
-
-#if PLATFORM(COCOA)
-static GlyphData glyphDataForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData&amp; data)
-{
-    GlyphData nonItalicData = data.font-&gt;nonSyntheticItalicFont()-&gt;glyphDataForCharacter(character);
-    if (nonItalicData.font)
-        return nonItalicData;
-    return data;
-}
-#endif
-    
-static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, const GlyphData&amp; data)
-{
-    if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
-        GlyphData uprightData = data.font-&gt;uprightOrientationFont()-&gt;glyphDataForCharacter(character);
-        // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
-        if (data.glyph == uprightData.glyph)
-            return data;
-        // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
-        // glyph, so we fall back to the upright data and use the horizontal glyph.
-        if (uprightData.font)
-            return uprightData;
-    } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
-        GlyphData verticalRightData = data.font-&gt;verticalRightOrientationFont()-&gt;glyphDataForCharacter(character);
-        // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
-        // into it.
-        if (data.glyph != verticalRightData.glyph)
-            return data;
-        // The glyphs are identical, meaning that we should just use the horizontal glyph.
-        if (verticalRightData.font)
-            return verticalRightData;
-    }
-    return data;
-}
-
-GlyphData FontGlyphs::glyphDataForSystemFallback(UChar32 c, const FontDescription&amp; description, FontVariant variant)
-{
-    // System fallback is character-dependent.
-    auto&amp; primaryRanges = realizeFallbackRangesAt(description, 0);
-    auto* originalFont = primaryRanges.fontForCharacter(c);
-    if (!originalFont)
-        originalFont = &amp;primaryRanges.fontForFirstRange();
-
-    RefPtr&lt;Font&gt; systemFallbackFont = originalFont-&gt;systemFallbackFontForCharacter(c, description, m_isForPlatformFont);
-    if (!systemFallbackFont)
-        return GlyphData();
-
-    if (systemFallbackFont-&gt;platformData().orientation() == Vertical &amp;&amp; !systemFallbackFont-&gt;hasVerticalGlyphs() &amp;&amp; FontCascade::isCJKIdeographOrSymbol(c))
-        variant = BrokenIdeographVariant;
-
-    GlyphData fallbackGlyphData;
-    if (variant == NormalVariant)
-        fallbackGlyphData = systemFallbackFont-&gt;glyphDataForCharacter(c);
-    else
-        fallbackGlyphData = systemFallbackFont-&gt;variantFont(description, variant)-&gt;glyphDataForCharacter(c);
-
-    if (variant == NormalVariant &amp;&amp; fallbackGlyphData.font) {
-        if (!FontCascade::isCJKIdeographOrSymbol(c) &amp;&amp; fallbackGlyphData.font-&gt;platformData().orientation() == Vertical &amp;&amp; !fallbackGlyphData.font-&gt;isTextOrientationFallback())
-            fallbackGlyphData = glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), fallbackGlyphData);
-    }
-
-    // Keep the system fallback fonts we use alive.
-    if (fallbackGlyphData.glyph)
-        m_systemFallbackFontSet.add(systemFallbackFont.release());
-
-    return fallbackGlyphData;
-}
-
-GlyphData FontGlyphs::glyphDataForVariant(UChar32 c, const FontDescription&amp; description, FontVariant variant, unsigned fallbackIndex)
-{
-    while (true) {
-        auto&amp; fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
-        if (fontRanges.isNull())
-            break;
-        auto* font = fontRanges.fontForCharacter(c);
-        GlyphData data = font ? font-&gt;glyphDataForCharacter(c) : GlyphData();
-        if (data.font) {
-            // The variantFont function should not normally return 0.
-            // But if it does, we will just render the capital letter big.
-            RefPtr&lt;Font&gt; variantFont = data.font-&gt;variantFont(description, variant);
-            if (!variantFont)
-                return data;
-
-            return variantFont-&gt;glyphDataForCharacter(c);
-        }
-    }
-
-    return glyphDataForSystemFallback(c, description, variant);
-}
-
-GlyphData FontGlyphs::glyphDataForNormalVariant(UChar32 c, const FontDescription&amp; description)
-{
-    const unsigned pageNumber = c / GlyphPage::size;
-
-    for (unsigned fallbackIndex = 0; true; ++fallbackIndex) {
-        auto&amp; fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
-        if (fontRanges.isNull())
-            break;
-        auto* font = fontRanges.fontForCharacter(c);
-        auto* page = font ? font-&gt;glyphPage(pageNumber) : nullptr;
-        if (!page)
-            continue;
-        GlyphData data = page-&gt;glyphDataForCharacter(c);
-        if (data.font) {
-            if (data.font-&gt;platformData().orientation() == Vertical &amp;&amp; !data.font-&gt;isTextOrientationFallback()) {
-                if (!FontCascade::isCJKIdeographOrSymbol(c))
-                    return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data);
-
-                if (!data.font-&gt;hasVerticalGlyphs()) {
-                    // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
-                    // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
-                    return glyphDataForVariant(c, description, BrokenIdeographVariant, fallbackIndex);
-                }
-#if PLATFORM(COCOA)
-                if (data.font-&gt;platformData().syntheticOblique())
-                    return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data);
-#endif
-            }
-
-            return data;
-        }
-    }
-
-    return glyphDataForSystemFallback(c, description, NormalVariant);
-}
-
-static RefPtr&lt;GlyphPage&gt; glyphPageFromFontRanges(unsigned pageNumber, const FontRanges&amp; fontRanges)
-{
-    const Font* font = nullptr;
-    UChar32 pageRangeFrom = pageNumber * GlyphPage::size;
-    UChar32 pageRangeTo = pageRangeFrom + GlyphPage::size - 1;
-    for (unsigned i = 0; i &lt; fontRanges.size(); ++i) {
-        auto&amp; range = fontRanges.rangeAt(i);
-        if (range.to()) {
-            if (range.from() &lt;= pageRangeFrom &amp;&amp; pageRangeTo &lt;= range.to())
-                font = &amp;range.font();
-            break;
-        }
-    }
-    if (!font)
-        return nullptr;
-
-    if (font-&gt;platformData().orientation() == Vertical)
-        return nullptr;
-
-    return const_cast&lt;GlyphPage*&gt;(font-&gt;glyphPage(pageNumber));
-}
-
-GlyphData FontGlyphs::glyphDataForCharacter(UChar32 c, const FontDescription&amp; description, FontVariant variant)
-{
-    ASSERT(isMainThread());
-    ASSERT(variant != AutoVariant);
-
-    if (variant != NormalVariant)
-        return glyphDataForVariant(c, description, variant, 0);
-
-    const unsigned pageNumber = c / GlyphPage::size;
-
-    RefPtr&lt;GlyphPage&gt;&amp; cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator-&gt;value : m_cachedPageZero;
-    if (!cachedPage)
-        cachedPage = glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0));
-
-    GlyphData glyphData = cachedPage ? cachedPage-&gt;glyphDataForCharacter(c) : GlyphData();
-    if (!glyphData.glyph) {
-        if (!cachedPage)
-            cachedPage = GlyphPage::createForMixedFonts();
-        else if (cachedPage-&gt;isImmutable())
-            cachedPage = GlyphPage::createCopyForMixedFonts(*cachedPage);
-
-        glyphData = glyphDataForNormalVariant(c, description);
-        cachedPage-&gt;setGlyphDataForCharacter(c, glyphData.glyph, glyphData.font);
-    }
-    return glyphData;
-}
-
-void FontGlyphs::pruneSystemFallbacks()
-{
-    if (m_systemFallbackFontSet.isEmpty())
-        return;
-    // Mutable glyph pages may reference fallback fonts.
-    if (m_cachedPageZero &amp;&amp; !m_cachedPageZero-&gt;isImmutable())
-        m_cachedPageZero = nullptr;
-    m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType&amp; keyAndValue) {
-        return !keyAndValue.value-&gt;isImmutable();
-    });
-    m_systemFallbackFontSet.clear();
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/FontGlyphs.h (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -1,122 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2010, 2013-2015 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef FontGlyphs_h
-#define FontGlyphs_h
-
-#include &quot;Font.h&quot;
-#include &quot;FontRanges.h&quot;
-#include &quot;FontSelector.h&quot;
-#include &quot;GlyphPage.h&quot;
-#include &quot;WidthCache.h&quot;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/MainThread.h&gt;
-
-#if PLATFORM(IOS)
-#include &quot;WebCoreThread.h&quot;
-#endif
-
-namespace WebCore {
-
-class GraphicsContext;
-class IntRect;
-class FontDescription;
-class FontPlatformData;
-class FontSelector;
-
-class FontGlyphs : public RefCounted&lt;FontGlyphs&gt; {
-    WTF_MAKE_NONCOPYABLE(FontGlyphs);
-public:
-    static Ref&lt;FontGlyphs&gt; create(PassRefPtr&lt;FontSelector&gt; fontSelector) { return adoptRef(*new FontGlyphs(fontSelector)); }
-    static Ref&lt;FontGlyphs&gt; createForPlatformFont(const FontPlatformData&amp; platformData) { return adoptRef(*new FontGlyphs(platformData)); }
-
-    WEBCORE_EXPORT ~FontGlyphs();
-
-    bool isForPlatformFont() const { return m_isForPlatformFont; }
-
-    GlyphData glyphDataForCharacter(UChar32, const FontDescription&amp;, FontVariant);
-
-    bool isFixedPitch(const FontDescription&amp;);
-    void determinePitch(const FontDescription&amp;);
-
-    bool isLoadingCustomFonts() const;
-
-    FontSelector* fontSelector() { return m_fontSelector.get(); }
-    // FIXME: It should be possible to combine fontSelectorVersion and generation.
-    unsigned fontSelectorVersion() const { return m_fontSelectorVersion; }
-    unsigned generation() const { return m_generation; }
-
-    WidthCache&amp; widthCache() { return m_widthCache; }
-    const WidthCache&amp; widthCache() const { return m_widthCache; }
-
-    const Font&amp; primaryFont(const FontDescription&amp;);
-    WEBCORE_EXPORT const FontRanges&amp; realizeFallbackRangesAt(const FontDescription&amp;, unsigned fallbackIndex);
-
-    void pruneSystemFallbacks();
-
-private:
-    FontGlyphs(PassRefPtr&lt;FontSelector&gt;);
-    FontGlyphs(const FontPlatformData&amp;);
-
-    GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&amp;, FontVariant);
-    GlyphData glyphDataForNormalVariant(UChar32, const FontDescription&amp;);
-    GlyphData glyphDataForVariant(UChar32, const FontDescription&amp;, FontVariant, unsigned fallbackIndex);
-
-    Vector&lt;FontRanges, 1&gt; m_realizedFallbackRanges;
-    unsigned m_lastRealizedFallbackIndex { 0 };
-
-    RefPtr&lt;GlyphPage&gt; m_cachedPageZero;
-    HashMap&lt;int, RefPtr&lt;GlyphPage&gt;&gt; m_cachedPages;
-
-    HashSet&lt;RefPtr&lt;Font&gt;&gt; m_systemFallbackFontSet;
-
-    const Font* m_cachedPrimaryFont;
-    RefPtr&lt;FontSelector&gt; m_fontSelector;
-
-    WidthCache m_widthCache;
-
-    unsigned m_fontSelectorVersion;
-    unsigned short m_generation;
-    Pitch m_pitch { UnknownPitch };
-    bool m_isForPlatformFont { false };
-};
-
-inline bool FontGlyphs::isFixedPitch(const FontDescription&amp; description)
-{
-    if (m_pitch == UnknownPitch)
-        determinePitch(description);
-    return m_pitch == FixedPitch;
-};
-
-inline const Font&amp; FontGlyphs::primaryFont(const FontDescription&amp; description)
-{
-    ASSERT(isMainThread());
-    if (!m_cachedPrimaryFont) {
-        auto&amp; primaryRanges = realizeFallbackRangesAt(description, 0);
-        m_cachedPrimaryFont = primaryRanges.fontForCharacter(' ');
-        if (!m_cachedPrimaryFont)
-            m_cachedPrimaryFont = &amp;primaryRanges.fontForFirstRange();
-    }
-    return *m_cachedPrimaryFont;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontWin.cpp (180293 => 180294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontWin.cpp        2015-02-18 22:15:44 UTC (rev 180293)
+++ trunk/Source/WebCore/platform/graphics/win/FontWin.cpp        2015-02-18 22:23:22 UTC (rev 180294)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include &quot;FontCascade.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Font.h&quot;
</span><del>-#include &quot;FontGlyphs.h&quot;
</del><span class="cx"> #include &quot;GlyphBuffer.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span></span></pre>
</div>
</div>

</body>
</html>