<!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.
"It is better than Impl."
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 <antti@apple.com>
+
+ Rename FontGlyphs to FontCascadeFonts
+ https://bugs.webkit.org/show_bug.cgi?id=141754
+
+ Reviewed by Andreas Kling.
+
+ "It is better than Impl."
+
+ 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 <commit-queue@webkit.org>
</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"> <ClCompile Include="..\platform\graphics\Font.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontCache.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontCascade.cpp" />
</span><ins>+ <ClCompile Include="..\platform\graphics\FontCascadeFonts.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\graphics\FontDescription.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontGenericFamilies.cpp" />
</span><del>- <ClCompile Include="..\platform\graphics\FontGlyphs.cpp" />
</del><span class="cx"> <ClCompile Include="..\platform\graphics\FontFeatureSettings.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontPlatformData.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontRanges.cpp" />
</span><span class="lines">@@ -19778,9 +19778,9 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\Font.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontCache.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontCascade.h" />
</span><ins>+ <ClInclude Include="..\platform\graphics\FontCascadeFonts.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\graphics\FontDescription.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontGenericFamilies.h" />
</span><del>- <ClInclude Include="..\platform\graphics\FontGlyphs.h" />
</del><span class="cx"> <ClInclude Include="..\platform\graphics\FontFeatureSettings.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontMetrics.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontPlatformData.h" />
</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 = "<group>"; };
</span><span class="cx">                 B2C3DA540D006CD600EF6F26 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2C3DA550D006CD600EF6F26 /* FontDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontDescription.h; sourceTree = "<group>"; };
</span><del>-                B2C3DA560D006CD600EF6F26 /* FontGlyphs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontGlyphs.cpp; sourceTree = "<group>"; };
-                B2C3DA570D006CD600EF6F26 /* FontGlyphs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontGlyphs.h; sourceTree = "<group>"; };
</del><ins>+                B2C3DA560D006CD600EF6F26 /* FontCascadeFonts.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontCascadeFonts.cpp; sourceTree = "<group>"; };
+                B2C3DA570D006CD600EF6F26 /* FontCascadeFonts.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCascadeFonts.h; sourceTree = "<group>"; };
</ins><span class="cx">                 B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontSelector.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphBuffer.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPathSegCustom.cpp; sourceTree = "<group>"; };
</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->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 "FontCache.h"
</span><span class="cx">
</span><span class="cx"> #include "FontCascade.h"
</span><del>-#include "FontGlyphs.h"
</del><span class="cx"> #include "FontPlatformData.h"
</span><span class="cx"> #include "FontSelector.h"
</span><span class="cx"> #include "MemoryPressureHandler.h"
</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<FontGlyphs> retrieveOrAddCachedFontGlyphs(const FontDescription&, PassRefPtr<FontSelector>);
</del><ins>+static Ref<FontCascadeFonts> retrieveOrAddCachedFonts(const FontDescription&, PassRefPtr<FontSelector>);
</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& font, FontSmoothingMode fontSmoothingMode)
- : m_glyphs(FontGlyphs::createForPlatformFont(font))
</del><ins>+FontCascade::FontCascade(const FontPlatformData& 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()) & kCTFontTraitItalic);
- m_fontDescription.setWeight((CTFontGetSymbolicTraits(font.font()) & kCTFontTraitBold) ? FontWeightBold : FontWeightNormal);
</del><ins>+ m_fontDescription.setSpecifiedSize(CTFontGetSize(fontData.font()));
+ m_fontDescription.setComputedSize(CTFontGetSize(fontData.font()));
+ m_fontDescription.setIsItalic(CTFontGetSymbolicTraits(fontData.font()) & kCTFontTraitItalic);
+ m_fontDescription.setWeight((CTFontGetSymbolicTraits(fontData.font()) & 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& font, PassRefPtr<FontSelector> fontSelector)
- : m_glyphs(FontGlyphs::createForPlatformFont(font))
- , m_letterSpacing(0)
</del><ins>+FontCascade::FontCascade(const FontPlatformData& fontData, PassRefPtr<FontSelector> 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) & kCTFontTraitItalic);
</span><span class="cx"> m_fontDescription.setWeight((CTFontGetSymbolicTraits(primaryFont) & 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& 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& FontCascade::operator=(const FontCascade& 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->fontSelector() != other.m_glyphs->fontSelector())
</del><ins>+ if (m_fonts->fontSelector() != other.m_fonts->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->fontSelectorVersion() != other.m_glyphs->fontSelectorVersion())
</del><ins>+ if (m_fonts->fontSelectorVersion() != other.m_fonts->fontSelectorVersion())
</ins><span class="cx"> return false;
</span><del>- if (m_glyphs->generation() != other.m_glyphs->generation())
</del><ins>+ if (m_fonts->generation() != other.m_fonts->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<AtomicString, 3> 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&& k, Ref<FontGlyphs>&& g)
- : key(WTF::move(k))
- , glyphs(WTF::move(g))
</del><ins>+ FontCascadeCacheEntry(FontCascadeCacheKey&& key, Ref<FontCascadeFonts>&& fonts)
+ : key(WTF::move(key))
+ , fonts(WTF::move(fonts))
</ins><span class="cx"> { }
</span><del>- FontGlyphsCacheKey key;
- Ref<FontGlyphs> glyphs;
</del><ins>+ FontCascadeCacheKey key;
+ Ref<FontCascadeFonts> fonts;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-typedef HashMap<unsigned, std::unique_ptr<FontGlyphsCacheEntry>, AlreadyHashed> FontGlyphsCache;
</del><ins>+typedef HashMap<unsigned, std::unique_ptr<FontCascadeCacheEntry>, AlreadyHashed> FontCascadeCache;
</ins><span class="cx">
</span><del>-static bool operator==(const FontGlyphsCacheKey& a, const FontGlyphsCacheKey& b)
</del><ins>+static bool operator==(const FontCascadeCacheKey& a, const FontCascadeCacheKey& 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& fontGlyphsCache()
</del><ins>+static FontCascadeCache& 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->value->glyphs.get().widthCache().clear();
</del><ins>+ for (auto& value : fontCascadeCache().values())
+ value->fonts.get().widthCache().clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static unsigned makeFontSelectorFlags(const FontDescription& description)
</span><span class="lines">@@ -259,17 +258,19 @@
</span><span class="cx"> return static_cast<unsigned>(description.script()) << 1 | static_cast<unsigned>(description.smallCaps());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void makeFontGlyphsCacheKey(FontGlyphsCacheKey& key, const FontDescription& description, FontSelector* fontSelector)
</del><ins>+static FontCascadeCacheKey makeFontCascadeCacheKey(const FontDescription& 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 < description.familyCount(); ++i)
</span><span class="cx"> key.families.append(description.familyAt(i));
</span><span class="cx"> key.fontSelectorId = fontSelector ? fontSelector->uniqueId() : 0;
</span><span class="cx"> key.fontSelectorVersion = fontSelector ? fontSelector->version() : 0;
</span><span class="cx"> key.fontSelectorFlags = fontSelector && fontSelector->resolvesFamilyFor(description) ? makeFontSelectorFlags(description) : 0;
</span><ins>+ return key;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static unsigned computeFontGlyphsCacheHash(const FontGlyphsCacheKey& key)
</del><ins>+static unsigned computeFontCascadeCacheHash(const FontCascadeCacheKey& key)
</ins><span class="cx"> {
</span><span class="cx"> Vector<unsigned, 7> 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& entry) {
- return entry.value->glyphs.get().hasOneRef();
</del><ins>+ fontCascadeCache().removeIf([](FontCascadeCache::KeyValuePairType& entry) {
+ return entry.value->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& entry : fontGlyphsCache().values())
- entry->glyphs->pruneSystemFallbacks();
</del><ins>+ for (auto& entry : fontCascadeCache().values())
+ entry->fonts->pruneSystemFallbacks();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static Ref<FontGlyphs> retrieveOrAddCachedFontGlyphs(const FontDescription& fontDescription, PassRefPtr<FontSelector> fontSelector)
</del><ins>+static Ref<FontCascadeFonts> retrieveOrAddCachedFonts(const FontDescription& fontDescription, PassRefPtr<FontSelector> 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<FontGlyphsCacheEntry>());
</del><ins>+ unsigned hash = computeFontCascadeCacheHash(key);
+ auto addResult = fontCascadeCache().add(hash, std::unique_ptr<FontCascadeCacheEntry>());
</ins><span class="cx"> if (!addResult.isNewEntry && addResult.iterator->value->key == key)
</span><del>- return addResult.iterator->value->glyphs.get();
</del><ins>+ return addResult.iterator->value->fonts.get();
</ins><span class="cx">
</span><del>- std::unique_ptr<FontGlyphsCacheEntry>& newEntry = addResult.iterator->value;
- newEntry = std::make_unique<FontGlyphsCacheEntry>(WTF::move(key), FontGlyphs::create(fontSelector));
- Ref<FontGlyphs> glyphs = newEntry->glyphs.get();
</del><ins>+ auto& newEntry = addResult.iterator->value;
+ newEntry = std::make_unique<FontCascadeCacheEntry>(WTF::move(key), FontCascadeFonts::create(fontSelector));
+ Ref<FontCascadeFonts> glyphs = newEntry->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() > maximumEntries)
- fontGlyphsCache().remove(fontGlyphsCache().begin());
</del><ins>+ if (fontCascadeCache().size() > 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<FontSelector> 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() & (Kerning | Ligatures);
</span><span class="cx"> bool hasWordSpacingOrLetterSpacing = wordSpacing() || letterSpacing();
</span><del>- float* cacheEntry = m_glyphs->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
</del><ins>+ float* cacheEntry = m_fonts->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
</ins><span class="cx"> if (cacheEntry && !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->glyphDataForCharacter(c, m_fontDescription, variant);
</del><ins>+ return m_fonts->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 && m_glyphs->isLoadingCustomFonts();
</del><ins>+ return m_fonts && m_fonts->isLoadingCustomFonts();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun& textRun, const GlyphBuffer& 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 "DashArray.h"
</span><span class="cx"> #include "Font.h"
</span><ins>+#include "FontCascadeFonts.h"
</ins><span class="cx"> #include "FontDescription.h"
</span><del>-#include "FontGlyphs.h"
</del><span class="cx"> #include "Path.h"
</span><span class="cx"> #include "TextDirection.h"
</span><span class="cx"> #include "TypesettingFeatures.h"
</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->isForPlatformFont(); }
</del><ins>+ bool isPlatformFont() const { return m_fonts->isForPlatformFont(); }
</ins><span class="cx">
</span><span class="cx"> const FontMetrics& 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<FontGlyphs> m_glyphs;
</del><ins>+ mutable RefPtr<FontCascadeFonts> 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& FontCascade::primaryFont() const
</span><span class="cx"> {
</span><del>- ASSERT(m_glyphs);
- return m_glyphs->primaryFont(m_fontDescription);
</del><ins>+ ASSERT(m_fonts);
+ return m_fonts->primaryFont(m_fontDescription);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline const FontRanges& FontCascade::fallbackRangesAt(unsigned index) const
</span><span class="cx"> {
</span><del>- ASSERT(m_glyphs);
- return m_glyphs->realizeFallbackRangesAt(m_fontDescription, index);
</del><ins>+ ASSERT(m_fonts);
+ return m_fonts->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->isFixedPitch(m_fontDescription);
</del><ins>+ ASSERT(m_fonts);
+ return m_fonts->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->fontSelector() : 0;
</del><ins>+ return m_fonts ? m_fonts->fontSelector() : 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline float FontCascade::tabWidth(const Font& 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. ("Apple") 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 "AS IS" 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 "config.h"
+#include "FontCascadeFonts.h"
+
+#include "FontCache.h"
+#include "FontCascade.h"
+#include "GlyphPage.h"
+
+namespace WebCore {
+
+
+FontCascadeFonts::FontCascadeFonts(PassRefPtr<FontSelector> fontSelector)
+ : m_cachedPrimaryFont(nullptr)
+ , m_fontSelector(fontSelector)
+ , m_fontSelectorVersion(m_fontSelector ? m_fontSelector->version() : 0)
+ , m_generation(FontCache::singleton().generation())
+{
+}
+
+FontCascadeFonts::FontCascadeFonts(const FontPlatformData& 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& description)
+{
+ auto& 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& fontRanges : m_realizedFallbackRanges) {
+ if (fontRanges.isLoading())
+ return true;
+ }
+ return false;
+}
+
+static FontRanges realizeNextFallback(const FontDescription& description, unsigned& index, FontSelector* fontSelector)
+{
+ ASSERT(index < description.familyCount());
+
+ auto& fontCache = FontCache::singleton();
+ while (index < description.familyCount()) {
+ const AtomicString& family = description.familyAt(index++);
+ if (family.isEmpty())
+ continue;
+ if (fontSelector) {
+ auto ranges = fontSelector->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& FontCascadeFonts::realizeFallbackRangesAt(const FontDescription& description, unsigned index)
+{
+ if (index < m_realizedFallbackRanges.size())
+ return m_realizedFallbackRanges[index];
+
+ ASSERT(index == m_realizedFallbackRanges.size());
+ ASSERT(FontCache::singleton().generation() == m_generation);
+
+ m_realizedFallbackRanges.append(FontRanges());
+ auto& fontRanges = m_realizedFallbackRanges.last();
+
+ if (!index) {
+ fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
+ if (fontRanges.isNull() && m_fontSelector)
+ fontRanges = m_fontSelector->fontRangesForFamily(description, standardFamily);
+ if (fontRanges.isNull())
+ fontRanges = FontRanges(FontCache::singleton().lastResortFallbackFont(description));
+ return fontRanges;
+ }
+
+ if (m_lastRealizedFallbackIndex < description.familyCount())
+ fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
+
+ if (fontRanges.isNull() && m_fontSelector) {
+ ASSERT(m_lastRealizedFallbackIndex >= description.familyCount());
+
+ unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.familyCount();
+ if (fontSelectorFallbackIndex == m_fontSelector->fallbackFontCount())
+ return fontRanges;
+ ++m_lastRealizedFallbackIndex;
+ fontRanges = FontRanges(m_fontSelector->fallbackFontAt(description, fontSelectorFallbackIndex));
+ }
+
+ return fontRanges;
+}
+
+static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
+{
+ return character >= lowerBound && character <= 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& data)
+{
+ GlyphData nonItalicData = data.font->nonSyntheticItalicFont()->glyphDataForCharacter(character);
+ if (nonItalicData.font)
+ return nonItalicData;
+ return data;
+}
+#endif
+
+static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, const GlyphData& data)
+{
+ if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
+ GlyphData uprightData = data.font->uprightOrientationFont()->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->verticalRightOrientationFont()->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& description, FontVariant variant)
+{
+ // System fallback is character-dependent.
+ auto& primaryRanges = realizeFallbackRangesAt(description, 0);
+ auto* originalFont = primaryRanges.fontForCharacter(c);
+ if (!originalFont)
+ originalFont = &primaryRanges.fontForFirstRange();
+
+ RefPtr<Font> systemFallbackFont = originalFont->systemFallbackFontForCharacter(c, description, m_isForPlatformFont);
+ if (!systemFallbackFont)
+ return GlyphData();
+
+ if (systemFallbackFont->platformData().orientation() == Vertical && !systemFallbackFont->hasVerticalGlyphs() && FontCascade::isCJKIdeographOrSymbol(c))
+ variant = BrokenIdeographVariant;
+
+ GlyphData fallbackGlyphData;
+ if (variant == NormalVariant)
+ fallbackGlyphData = systemFallbackFont->glyphDataForCharacter(c);
+ else
+ fallbackGlyphData = systemFallbackFont->variantFont(description, variant)->glyphDataForCharacter(c);
+
+ if (variant == NormalVariant && fallbackGlyphData.font) {
+ if (!FontCascade::isCJKIdeographOrSymbol(c) && fallbackGlyphData.font->platformData().orientation() == Vertical && !fallbackGlyphData.font->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& description, FontVariant variant, unsigned fallbackIndex)
+{
+ while (true) {
+ auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
+ if (fontRanges.isNull())
+ break;
+ auto* font = fontRanges.fontForCharacter(c);
+ GlyphData data = font ? font->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<Font> variantFont = data.font->variantFont(description, variant);
+ if (!variantFont)
+ return data;
+
+ return variantFont->glyphDataForCharacter(c);
+ }
+ }
+
+ return glyphDataForSystemFallback(c, description, variant);
+}
+
+GlyphData FontCascadeFonts::glyphDataForNormalVariant(UChar32 c, const FontDescription& description)
+{
+ const unsigned pageNumber = c / GlyphPage::size;
+
+ for (unsigned fallbackIndex = 0; true; ++fallbackIndex) {
+ auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
+ if (fontRanges.isNull())
+ break;
+ auto* font = fontRanges.fontForCharacter(c);
+ auto* page = font ? font->glyphPage(pageNumber) : nullptr;
+ if (!page)
+ continue;
+ GlyphData data = page->glyphDataForCharacter(c);
+ if (data.font) {
+ if (data.font->platformData().orientation() == Vertical && !data.font->isTextOrientationFallback()) {
+ if (!FontCascade::isCJKIdeographOrSymbol(c))
+ return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data);
+
+ if (!data.font->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->platformData().syntheticOblique())
+ return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data);
+#endif
+ }
+
+ return data;
+ }
+ }
+
+ return glyphDataForSystemFallback(c, description, NormalVariant);
+}
+
+static RefPtr<GlyphPage> glyphPageFromFontRanges(unsigned pageNumber, const FontRanges& fontRanges)
+{
+ const Font* font = nullptr;
+ UChar32 pageRangeFrom = pageNumber * GlyphPage::size;
+ UChar32 pageRangeTo = pageRangeFrom + GlyphPage::size - 1;
+ for (unsigned i = 0; i < fontRanges.size(); ++i) {
+ auto& range = fontRanges.rangeAt(i);
+ if (range.to()) {
+ if (range.from() <= pageRangeFrom && pageRangeTo <= range.to())
+ font = &range.font();
+ break;
+ }
+ }
+ if (!font)
+ return nullptr;
+
+ if (font->platformData().orientation() == Vertical)
+ return nullptr;
+
+ return const_cast<GlyphPage*>(font->glyphPage(pageNumber));
+}
+
+GlyphData FontCascadeFonts::glyphDataForCharacter(UChar32 c, const FontDescription& description, FontVariant variant)
+{
+ ASSERT(isMainThread());
+ ASSERT(variant != AutoVariant);
+
+ if (variant != NormalVariant)
+ return glyphDataForVariant(c, description, variant, 0);
+
+ const unsigned pageNumber = c / GlyphPage::size;
+
+ RefPtr<GlyphPage>& cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator->value : m_cachedPageZero;
+ if (!cachedPage)
+ cachedPage = glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0));
+
+ GlyphData glyphData = cachedPage ? cachedPage->glyphDataForCharacter(c) : GlyphData();
+ if (!glyphData.glyph) {
+ if (!cachedPage)
+ cachedPage = GlyphPage::createForMixedFonts();
+ else if (cachedPage->isImmutable())
+ cachedPage = GlyphPage::createCopyForMixedFonts(*cachedPage);
+
+ glyphData = glyphDataForNormalVariant(c, description);
+ cachedPage->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 && !m_cachedPageZero->isImmutable())
+ m_cachedPageZero = nullptr;
+ m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType& keyAndValue) {
+ return !keyAndValue.value->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 "Font.h"
+#include "FontRanges.h"
+#include "FontSelector.h"
+#include "GlyphPage.h"
+#include "WidthCache.h"
+#include <wtf/Forward.h>
+#include <wtf/MainThread.h>
+
+#if PLATFORM(IOS)
+#include "WebCoreThread.h"
+#endif
+
+namespace WebCore {
+
+class GraphicsContext;
+class IntRect;
+class FontDescription;
+class FontPlatformData;
+class FontSelector;
+
+class FontCascadeFonts : public RefCounted<FontCascadeFonts> {
+ WTF_MAKE_NONCOPYABLE(FontCascadeFonts);
+public:
+ static Ref<FontCascadeFonts> create(PassRefPtr<FontSelector> fontSelector) { return adoptRef(*new FontCascadeFonts(fontSelector)); }
+ static Ref<FontCascadeFonts> createForPlatformFont(const FontPlatformData& platformData) { return adoptRef(*new FontCascadeFonts(platformData)); }
+
+ WEBCORE_EXPORT ~FontCascadeFonts();
+
+ bool isForPlatformFont() const { return m_isForPlatformFont; }
+
+ GlyphData glyphDataForCharacter(UChar32, const FontDescription&, FontVariant);
+
+ bool isFixedPitch(const FontDescription&);
+ void determinePitch(const FontDescription&);
+
+ 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& widthCache() { return m_widthCache; }
+ const WidthCache& widthCache() const { return m_widthCache; }
+
+ const Font& primaryFont(const FontDescription&);
+ WEBCORE_EXPORT const FontRanges& realizeFallbackRangesAt(const FontDescription&, unsigned fallbackIndex);
+
+ void pruneSystemFallbacks();
+
+private:
+ FontCascadeFonts(PassRefPtr<FontSelector>);
+ FontCascadeFonts(const FontPlatformData&);
+
+ GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&, FontVariant);
+ GlyphData glyphDataForNormalVariant(UChar32, const FontDescription&);
+ GlyphData glyphDataForVariant(UChar32, const FontDescription&, FontVariant, unsigned fallbackIndex);
+
+ Vector<FontRanges, 1> m_realizedFallbackRanges;
+ unsigned m_lastRealizedFallbackIndex { 0 };
+
+ RefPtr<GlyphPage> m_cachedPageZero;
+ HashMap<int, RefPtr<GlyphPage>> m_cachedPages;
+
+ HashSet<RefPtr<Font>> m_systemFallbackFontSet;
+
+ const Font* m_cachedPrimaryFont;
+ RefPtr<FontSelector> 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& description)
+{
+ if (m_pitch == UnknownPitch)
+ determinePitch(description);
+ return m_pitch == FixedPitch;
+};
+
+inline const Font& FontCascadeFonts::primaryFont(const FontDescription& description)
+{
+ ASSERT(isMainThread());
+ if (!m_cachedPrimaryFont) {
+ auto& primaryRanges = realizeFallbackRangesAt(description, 0);
+ m_cachedPrimaryFont = primaryRanges.fontForCharacter(' ');
+ if (!m_cachedPrimaryFont)
+ m_cachedPrimaryFont = &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. ("Apple") 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 "AS IS" 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 "config.h"
-#include "FontGlyphs.h"
-
-#include "FontCache.h"
-#include "FontCascade.h"
-#include "GlyphPage.h"
-
-namespace WebCore {
-
-
-FontGlyphs::FontGlyphs(PassRefPtr<FontSelector> fontSelector)
- : m_cachedPrimaryFont(nullptr)
- , m_fontSelector(fontSelector)
- , m_fontSelectorVersion(m_fontSelector ? m_fontSelector->version() : 0)
- , m_generation(FontCache::singleton().generation())
-{
-}
-
-FontGlyphs::FontGlyphs(const FontPlatformData& 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& description)
-{
- auto& 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& fontRanges : m_realizedFallbackRanges) {
- if (fontRanges.isLoading())
- return true;
- }
- return false;
-}
-
-static FontRanges realizeNextFallback(const FontDescription& description, unsigned& index, FontSelector* fontSelector)
-{
- ASSERT(index < description.familyCount());
-
- auto& fontCache = FontCache::singleton();
- while (index < description.familyCount()) {
- const AtomicString& family = description.familyAt(index++);
- if (family.isEmpty())
- continue;
- if (fontSelector) {
- auto ranges = fontSelector->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& FontGlyphs::realizeFallbackRangesAt(const FontDescription& description, unsigned index)
-{
- if (index < m_realizedFallbackRanges.size())
- return m_realizedFallbackRanges[index];
-
- ASSERT(index == m_realizedFallbackRanges.size());
- ASSERT(FontCache::singleton().generation() == m_generation);
-
- m_realizedFallbackRanges.append(FontRanges());
- auto& fontRanges = m_realizedFallbackRanges.last();
-
- if (!index) {
- fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
- if (fontRanges.isNull() && m_fontSelector)
- fontRanges = m_fontSelector->fontRangesForFamily(description, standardFamily);
- if (fontRanges.isNull())
- fontRanges = FontRanges(FontCache::singleton().lastResortFallbackFont(description));
- return fontRanges;
- }
-
- if (m_lastRealizedFallbackIndex < description.familyCount())
- fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
-
- if (fontRanges.isNull() && m_fontSelector) {
- ASSERT(m_lastRealizedFallbackIndex >= description.familyCount());
-
- unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.familyCount();
- if (fontSelectorFallbackIndex == m_fontSelector->fallbackFontCount())
- return fontRanges;
- ++m_lastRealizedFallbackIndex;
- fontRanges = FontRanges(m_fontSelector->fallbackFontAt(description, fontSelectorFallbackIndex));
- }
-
- return fontRanges;
-}
-
-static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
-{
- return character >= lowerBound && character <= 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& data)
-{
- GlyphData nonItalicData = data.font->nonSyntheticItalicFont()->glyphDataForCharacter(character);
- if (nonItalicData.font)
- return nonItalicData;
- return data;
-}
-#endif
-
-static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, const GlyphData& data)
-{
- if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
- GlyphData uprightData = data.font->uprightOrientationFont()->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->verticalRightOrientationFont()->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& description, FontVariant variant)
-{
- // System fallback is character-dependent.
- auto& primaryRanges = realizeFallbackRangesAt(description, 0);
- auto* originalFont = primaryRanges.fontForCharacter(c);
- if (!originalFont)
- originalFont = &primaryRanges.fontForFirstRange();
-
- RefPtr<Font> systemFallbackFont = originalFont->systemFallbackFontForCharacter(c, description, m_isForPlatformFont);
- if (!systemFallbackFont)
- return GlyphData();
-
- if (systemFallbackFont->platformData().orientation() == Vertical && !systemFallbackFont->hasVerticalGlyphs() && FontCascade::isCJKIdeographOrSymbol(c))
- variant = BrokenIdeographVariant;
-
- GlyphData fallbackGlyphData;
- if (variant == NormalVariant)
- fallbackGlyphData = systemFallbackFont->glyphDataForCharacter(c);
- else
- fallbackGlyphData = systemFallbackFont->variantFont(description, variant)->glyphDataForCharacter(c);
-
- if (variant == NormalVariant && fallbackGlyphData.font) {
- if (!FontCascade::isCJKIdeographOrSymbol(c) && fallbackGlyphData.font->platformData().orientation() == Vertical && !fallbackGlyphData.font->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& description, FontVariant variant, unsigned fallbackIndex)
-{
- while (true) {
- auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
- if (fontRanges.isNull())
- break;
- auto* font = fontRanges.fontForCharacter(c);
- GlyphData data = font ? font->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<Font> variantFont = data.font->variantFont(description, variant);
- if (!variantFont)
- return data;
-
- return variantFont->glyphDataForCharacter(c);
- }
- }
-
- return glyphDataForSystemFallback(c, description, variant);
-}
-
-GlyphData FontGlyphs::glyphDataForNormalVariant(UChar32 c, const FontDescription& description)
-{
- const unsigned pageNumber = c / GlyphPage::size;
-
- for (unsigned fallbackIndex = 0; true; ++fallbackIndex) {
- auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
- if (fontRanges.isNull())
- break;
- auto* font = fontRanges.fontForCharacter(c);
- auto* page = font ? font->glyphPage(pageNumber) : nullptr;
- if (!page)
- continue;
- GlyphData data = page->glyphDataForCharacter(c);
- if (data.font) {
- if (data.font->platformData().orientation() == Vertical && !data.font->isTextOrientationFallback()) {
- if (!FontCascade::isCJKIdeographOrSymbol(c))
- return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data);
-
- if (!data.font->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->platformData().syntheticOblique())
- return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data);
-#endif
- }
-
- return data;
- }
- }
-
- return glyphDataForSystemFallback(c, description, NormalVariant);
-}
-
-static RefPtr<GlyphPage> glyphPageFromFontRanges(unsigned pageNumber, const FontRanges& fontRanges)
-{
- const Font* font = nullptr;
- UChar32 pageRangeFrom = pageNumber * GlyphPage::size;
- UChar32 pageRangeTo = pageRangeFrom + GlyphPage::size - 1;
- for (unsigned i = 0; i < fontRanges.size(); ++i) {
- auto& range = fontRanges.rangeAt(i);
- if (range.to()) {
- if (range.from() <= pageRangeFrom && pageRangeTo <= range.to())
- font = &range.font();
- break;
- }
- }
- if (!font)
- return nullptr;
-
- if (font->platformData().orientation() == Vertical)
- return nullptr;
-
- return const_cast<GlyphPage*>(font->glyphPage(pageNumber));
-}
-
-GlyphData FontGlyphs::glyphDataForCharacter(UChar32 c, const FontDescription& description, FontVariant variant)
-{
- ASSERT(isMainThread());
- ASSERT(variant != AutoVariant);
-
- if (variant != NormalVariant)
- return glyphDataForVariant(c, description, variant, 0);
-
- const unsigned pageNumber = c / GlyphPage::size;
-
- RefPtr<GlyphPage>& cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator->value : m_cachedPageZero;
- if (!cachedPage)
- cachedPage = glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0));
-
- GlyphData glyphData = cachedPage ? cachedPage->glyphDataForCharacter(c) : GlyphData();
- if (!glyphData.glyph) {
- if (!cachedPage)
- cachedPage = GlyphPage::createForMixedFonts();
- else if (cachedPage->isImmutable())
- cachedPage = GlyphPage::createCopyForMixedFonts(*cachedPage);
-
- glyphData = glyphDataForNormalVariant(c, description);
- cachedPage->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 && !m_cachedPageZero->isImmutable())
- m_cachedPageZero = nullptr;
- m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType& keyAndValue) {
- return !keyAndValue.value->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 "Font.h"
-#include "FontRanges.h"
-#include "FontSelector.h"
-#include "GlyphPage.h"
-#include "WidthCache.h"
-#include <wtf/Forward.h>
-#include <wtf/MainThread.h>
-
-#if PLATFORM(IOS)
-#include "WebCoreThread.h"
-#endif
-
-namespace WebCore {
-
-class GraphicsContext;
-class IntRect;
-class FontDescription;
-class FontPlatformData;
-class FontSelector;
-
-class FontGlyphs : public RefCounted<FontGlyphs> {
- WTF_MAKE_NONCOPYABLE(FontGlyphs);
-public:
- static Ref<FontGlyphs> create(PassRefPtr<FontSelector> fontSelector) { return adoptRef(*new FontGlyphs(fontSelector)); }
- static Ref<FontGlyphs> createForPlatformFont(const FontPlatformData& platformData) { return adoptRef(*new FontGlyphs(platformData)); }
-
- WEBCORE_EXPORT ~FontGlyphs();
-
- bool isForPlatformFont() const { return m_isForPlatformFont; }
-
- GlyphData glyphDataForCharacter(UChar32, const FontDescription&, FontVariant);
-
- bool isFixedPitch(const FontDescription&);
- void determinePitch(const FontDescription&);
-
- 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& widthCache() { return m_widthCache; }
- const WidthCache& widthCache() const { return m_widthCache; }
-
- const Font& primaryFont(const FontDescription&);
- WEBCORE_EXPORT const FontRanges& realizeFallbackRangesAt(const FontDescription&, unsigned fallbackIndex);
-
- void pruneSystemFallbacks();
-
-private:
- FontGlyphs(PassRefPtr<FontSelector>);
- FontGlyphs(const FontPlatformData&);
-
- GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&, FontVariant);
- GlyphData glyphDataForNormalVariant(UChar32, const FontDescription&);
- GlyphData glyphDataForVariant(UChar32, const FontDescription&, FontVariant, unsigned fallbackIndex);
-
- Vector<FontRanges, 1> m_realizedFallbackRanges;
- unsigned m_lastRealizedFallbackIndex { 0 };
-
- RefPtr<GlyphPage> m_cachedPageZero;
- HashMap<int, RefPtr<GlyphPage>> m_cachedPages;
-
- HashSet<RefPtr<Font>> m_systemFallbackFontSet;
-
- const Font* m_cachedPrimaryFont;
- RefPtr<FontSelector> 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& description)
-{
- if (m_pitch == UnknownPitch)
- determinePitch(description);
- return m_pitch == FixedPitch;
-};
-
-inline const Font& FontGlyphs::primaryFont(const FontDescription& description)
-{
- ASSERT(isMainThread());
- if (!m_cachedPrimaryFont) {
- auto& primaryRanges = realizeFallbackRangesAt(description, 0);
- m_cachedPrimaryFont = primaryRanges.fontForCharacter(' ');
- if (!m_cachedPrimaryFont)
- m_cachedPrimaryFont = &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 "FontCascade.h"
</span><span class="cx">
</span><span class="cx"> #include "Font.h"
</span><del>-#include "FontGlyphs.h"
</del><span class="cx"> #include "GlyphBuffer.h"
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "IntRect.h"
</span></span></pre>
</div>
</div>
</body>
</html>