<!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>[178388] 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/178388">178388</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-01-13 15:57:50 -0800 (Tue, 13 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Devirtualize FontData
https://bugs.webkit.org/show_bug.cgi?id=140390
Reviewed by Andreas Kling.
This patch removes the FontData base class and turns SegmentedFontData into a non-virtual FontRanges type.
SimpleFontData remains as is (without the base) and it can be renamed later to something more sensible.
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::fallbackFontDataAt):
(WebCore::CSSFontSelector::getFontData): Deleted.
(WebCore::CSSFontSelector::getFallbackFontData): Deleted.
* css/CSSFontSelector.h:
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::pruneTable):
(WebCore::appendFontDataWithInvalidUnicodeRangeIfLoading):
(WebCore::CSSSegmentedFontFace::fontRanges):
(WebCore::CSSSegmentedFontFace::loadFont):
(WebCore::CSSSegmentedFontFace::getFontData): Deleted.
* css/CSSSegmentedFontFace.h:
* platform/graphics/Font.h:
(WebCore::Font::fallbackRangesAt):
(WebCore::Font::fontDataAt): Deleted.
* platform/graphics/FontData.cpp: Removed.
* platform/graphics/FontData.h: Removed.
* platform/graphics/FontGlyphs.cpp:
(WebCore::FontGlyphs::FontGlyphs):
(WebCore::FontGlyphs::determinePitch):
(WebCore::FontGlyphs::isLoadingCustomFonts):
(WebCore::realizeNextFallback):
(WebCore::FontGlyphs::realizeFallbackRangesAt):
(WebCore::FontGlyphs::glyphDataForSystemFallback):
(WebCore::FontGlyphs::glyphDataForVariant):
(WebCore::FontGlyphs::glyphDataForNormalVariant):
(WebCore::glyphPageFromFontRanges):
(WebCore::FontGlyphs::glyphDataForCharacter):
(WebCore::realizeNextFamily): Deleted.
(WebCore::FontGlyphs::realizeFontDataAt): Deleted.
(WebCore::glyphPageFromFontData): Deleted.
* platform/graphics/FontGlyphs.h:
(WebCore::FontGlyphs::primarySimpleFontData):
* platform/graphics/FontRanges.cpp: Copied from Source/WebCore/platform/graphics/SegmentedFontData.cpp.
(WebCore::FontRanges::FontRanges):
(WebCore::FontRanges::~FontRanges):
(WebCore::FontRanges::fontDataForCharacter):
(WebCore::FontRanges::fontDataForFirstRange):
(WebCore::FontRanges::isLoading):
(WebCore::SegmentedFontData::SegmentedFontData): Deleted.
(WebCore::SegmentedFontData::~SegmentedFontData): Deleted.
(WebCore::SegmentedFontData::simpleFontDataForCharacter): Deleted.
(WebCore::SegmentedFontData::simpleFontDataForFirstRange): Deleted.
(WebCore::SegmentedFontData::isCustomFont): Deleted.
(WebCore::SegmentedFontData::isLoading): Deleted.
(WebCore::SegmentedFontData::isSegmented): Deleted.
(WebCore::SegmentedFontData::description): Deleted.
* platform/graphics/FontRanges.h: Copied from Source/WebCore/platform/graphics/SegmentedFontData.h.
(WebCore::FontRanges::Range::Range):
(WebCore::FontRanges::Range::from):
(WebCore::FontRanges::Range::to):
(WebCore::FontRanges::Range::fontData):
(WebCore::FontRanges::isEmpty):
(WebCore::FontRanges::appendRange):
(WebCore::FontRanges::size):
(WebCore::FontRanges::rangeAt):
(WebCore::FontDataRange::FontDataRange): Deleted.
(WebCore::FontDataRange::from): Deleted.
(WebCore::FontDataRange::to): Deleted.
(WebCore::FontDataRange::fontData): Deleted.
(WebCore::SegmentedFontData::create): Deleted.
(WebCore::SegmentedFontData::appendRange): Deleted.
(WebCore::SegmentedFontData::numRanges): Deleted.
(WebCore::SegmentedFontData::rangeAt): Deleted.
(isType): Deleted.
* platform/graphics/FontSelector.h:
* platform/graphics/SegmentedFontData.cpp: Removed.
* platform/graphics/SegmentedFontData.h: Removed.
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::simpleFontDataForCharacter): Deleted.
(WebCore::SimpleFontData::simpleFontDataForFirstRange): Deleted.
(WebCore::SimpleFontData::isSegmented): Deleted.
* platform/graphics/SimpleFontData.h:
(WebCore::SimpleFontData::isCustomFont):
(WebCore::SimpleFontData::isLoading):
(isType): Deleted.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(-[WebCascadeList initWithFont:character:]):
(-[WebCascadeList objectAtIndex:]):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FontComplexTextMac.cpp:
(WebCore::Font::fontDataForCombiningCharacterSequence):</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="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</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="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorh">trunk/Source/WebCore/css/CSSFontSelector.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSSegmentedFontFacecpp">trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSegmentedFontFaceh">trunk/Source/WebCore/css/CSSSegmentedFontFace.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFonth">trunk/Source/WebCore/platform/graphics/Font.h</a></li>
<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>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontSelectorh">trunk/Source/WebCore/platform/graphics/FontSelector.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSimpleFontDatacpp">trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSimpleFontDatah">trunk/Source/WebCore/platform/graphics/SimpleFontData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm">trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontComplexTextMaccpp">trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontRangescpp">trunk/Source/WebCore/platform/graphics/FontRanges.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontRangesh">trunk/Source/WebCore/platform/graphics/FontRanges.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDatacpp">trunk/Source/WebCore/platform/graphics/FontData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDatah">trunk/Source/WebCore/platform/graphics/FontData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSegmentedFontDatacpp">trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSegmentedFontDatah">trunk/Source/WebCore/platform/graphics/SegmentedFontData.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 (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -2051,12 +2051,12 @@
</span><span class="cx"> platform/graphics/FloatSize.cpp
</span><span class="cx"> platform/graphics/Font.cpp
</span><span class="cx"> platform/graphics/FontCache.cpp
</span><del>- platform/graphics/FontData.cpp
</del><span class="cx"> platform/graphics/FontDescription.cpp
</span><span class="cx"> platform/graphics/FontFastPath.cpp
</span><span class="cx"> platform/graphics/FontFeatureSettings.cpp
</span><span class="cx"> platform/graphics/FontGenericFamilies.cpp
</span><span class="cx"> platform/graphics/FontGlyphs.cpp
</span><ins>+ platform/graphics/FontRanges.cpp
</ins><span class="cx"> platform/graphics/GeneratedImage.cpp
</span><span class="cx"> platform/graphics/GeometryUtilities.cpp
</span><span class="cx"> platform/graphics/Gradient.cpp
</span><span class="lines">@@ -2084,7 +2084,6 @@
</span><span class="cx"> platform/graphics/Region.cpp
</span><span class="cx"> platform/graphics/RoundedRect.cpp
</span><span class="cx"> platform/graphics/SVGGlyph.cpp
</span><del>- platform/graphics/SegmentedFontData.cpp
</del><span class="cx"> platform/graphics/ShadowBlur.cpp
</span><span class="cx"> platform/graphics/SimpleFontData.cpp
</span><span class="cx"> platform/graphics/StringTruncator.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/ChangeLog        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -1,3 +1,100 @@
</span><ins>+2015-01-13 Antti Koivisto <antti@apple.com>
+
+ Devirtualize FontData
+ https://bugs.webkit.org/show_bug.cgi?id=140390
+
+ Reviewed by Andreas Kling.
+
+ This patch removes the FontData base class and turns SegmentedFontData into a non-virtual FontRanges type.
+
+ SimpleFontData remains as is (without the base) and it can be renamed later to something more sensible.
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSFontSelector.cpp:
+ (WebCore::CSSFontSelector::fontRangesForFamily):
+ (WebCore::CSSFontSelector::fallbackFontDataAt):
+ (WebCore::CSSFontSelector::getFontData): Deleted.
+ (WebCore::CSSFontSelector::getFallbackFontData): Deleted.
+ * css/CSSFontSelector.h:
+ * css/CSSSegmentedFontFace.cpp:
+ (WebCore::CSSSegmentedFontFace::pruneTable):
+ (WebCore::appendFontDataWithInvalidUnicodeRangeIfLoading):
+ (WebCore::CSSSegmentedFontFace::fontRanges):
+ (WebCore::CSSSegmentedFontFace::loadFont):
+ (WebCore::CSSSegmentedFontFace::getFontData): Deleted.
+ * css/CSSSegmentedFontFace.h:
+ * platform/graphics/Font.h:
+ (WebCore::Font::fallbackRangesAt):
+ (WebCore::Font::fontDataAt): Deleted.
+ * platform/graphics/FontData.cpp: Removed.
+ * platform/graphics/FontData.h: Removed.
+ * platform/graphics/FontGlyphs.cpp:
+ (WebCore::FontGlyphs::FontGlyphs):
+ (WebCore::FontGlyphs::determinePitch):
+ (WebCore::FontGlyphs::isLoadingCustomFonts):
+ (WebCore::realizeNextFallback):
+ (WebCore::FontGlyphs::realizeFallbackRangesAt):
+ (WebCore::FontGlyphs::glyphDataForSystemFallback):
+ (WebCore::FontGlyphs::glyphDataForVariant):
+ (WebCore::FontGlyphs::glyphDataForNormalVariant):
+ (WebCore::glyphPageFromFontRanges):
+ (WebCore::FontGlyphs::glyphDataForCharacter):
+ (WebCore::realizeNextFamily): Deleted.
+ (WebCore::FontGlyphs::realizeFontDataAt): Deleted.
+ (WebCore::glyphPageFromFontData): Deleted.
+ * platform/graphics/FontGlyphs.h:
+ (WebCore::FontGlyphs::primarySimpleFontData):
+ * platform/graphics/FontRanges.cpp: Copied from Source/WebCore/platform/graphics/SegmentedFontData.cpp.
+ (WebCore::FontRanges::FontRanges):
+ (WebCore::FontRanges::~FontRanges):
+ (WebCore::FontRanges::fontDataForCharacter):
+ (WebCore::FontRanges::fontDataForFirstRange):
+ (WebCore::FontRanges::isLoading):
+ (WebCore::SegmentedFontData::SegmentedFontData): Deleted.
+ (WebCore::SegmentedFontData::~SegmentedFontData): Deleted.
+ (WebCore::SegmentedFontData::simpleFontDataForCharacter): Deleted.
+ (WebCore::SegmentedFontData::simpleFontDataForFirstRange): Deleted.
+ (WebCore::SegmentedFontData::isCustomFont): Deleted.
+ (WebCore::SegmentedFontData::isLoading): Deleted.
+ (WebCore::SegmentedFontData::isSegmented): Deleted.
+ (WebCore::SegmentedFontData::description): Deleted.
+ * platform/graphics/FontRanges.h: Copied from Source/WebCore/platform/graphics/SegmentedFontData.h.
+ (WebCore::FontRanges::Range::Range):
+ (WebCore::FontRanges::Range::from):
+ (WebCore::FontRanges::Range::to):
+ (WebCore::FontRanges::Range::fontData):
+ (WebCore::FontRanges::isEmpty):
+ (WebCore::FontRanges::appendRange):
+ (WebCore::FontRanges::size):
+ (WebCore::FontRanges::rangeAt):
+ (WebCore::FontDataRange::FontDataRange): Deleted.
+ (WebCore::FontDataRange::from): Deleted.
+ (WebCore::FontDataRange::to): Deleted.
+ (WebCore::FontDataRange::fontData): Deleted.
+ (WebCore::SegmentedFontData::create): Deleted.
+ (WebCore::SegmentedFontData::appendRange): Deleted.
+ (WebCore::SegmentedFontData::numRanges): Deleted.
+ (WebCore::SegmentedFontData::rangeAt): Deleted.
+ (isType): Deleted.
+ * platform/graphics/FontSelector.h:
+ * platform/graphics/SegmentedFontData.cpp: Removed.
+ * platform/graphics/SegmentedFontData.h: Removed.
+ * platform/graphics/SimpleFontData.cpp:
+ (WebCore::SimpleFontData::simpleFontDataForCharacter): Deleted.
+ (WebCore::SimpleFontData::simpleFontDataForFirstRange): Deleted.
+ (WebCore::SimpleFontData::isSegmented): Deleted.
+ * platform/graphics/SimpleFontData.h:
+ (WebCore::SimpleFontData::isCustomFont):
+ (WebCore::SimpleFontData::isLoading):
+ (isType): Deleted.
+ * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+ (-[WebCascadeList initWithFont:character:]):
+ (-[WebCascadeList objectAtIndex:]):
+ (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+ * platform/graphics/mac/FontComplexTextMac.cpp:
+ (WebCore::Font::fontDataForCombiningCharacterSequence):
+
</ins><span class="cx"> 2015-01-13 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Filters aren't applied to elements in columns after the first
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> __ZN7WebCore10CredentialC1EP15NSURLCredential
</span><span class="cx"> __ZN7WebCore10FloatPointC1ERK7CGPoint
</span><span class="cx"> __ZN7WebCore10FloatPointC1ERKNS_8IntPointE
</span><del>-__ZN7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj
</del><ins>+__ZN7WebCore10FontGlyphs23realizeFallbackRangesAtERKNS_15FontDescriptionEj
</ins><span class="cx"> __ZN7WebCore10FontGlyphsD1Ev
</span><span class="cx"> __ZN7WebCore10JSDocument6s_infoE
</span><span class="cx"> __ZN7WebCore10JSDocument9toWrappedEN3JSC7JSValueE
</span><span class="lines">@@ -459,6 +459,7 @@
</span><span class="cx"> __ZN7WebCore14SecurityPolicy27resetOriginAccessWhitelistsEv
</span><span class="cx"> __ZN7WebCore14SecurityPolicy29addOriginAccessWhitelistEntryERKNS_14SecurityOriginERKN3WTF6StringES7_b
</span><span class="cx"> __ZN7WebCore14SecurityPolicy32removeOriginAccessWhitelistEntryERKNS_14SecurityOriginERKN3WTF6StringES7_b
</span><ins>+__ZN7WebCore14SimpleFontDataD1Ev
</ins><span class="cx"> __ZN7WebCore14SubframeLoader12allowPluginsENS_28ReasonForCallingAllowPluginsE
</span><span class="cx"> __ZN7WebCore14TileController14setTilesOpaqueEb
</span><span class="cx"> __ZN7WebCore14TileController15containerLayersEv
</span><span class="lines">@@ -1585,6 +1586,8 @@
</span><span class="cx"> __ZNK7WebCore10Credential12nsCredentialEv
</span><span class="cx"> __ZNK7WebCore10Credential7isEmptyEv
</span><span class="cx"> __ZNK7WebCore10FloatPointcv7CGPointEv
</span><ins>+__ZNK7WebCore10FontRanges20fontDataForCharacterEi
+__ZNK7WebCore10FontRanges21fontDataForFirstRangeEv
</ins><span class="cx"> __ZNK7WebCore10LayoutRect8containsERKS0_
</span><span class="cx"> __ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringENS0_18AllowedPluginTypesE
</span><span class="cx"> __ZNK7WebCore10RenderText16firstRunLocationEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -7980,13 +7980,13 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FloatSize.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\Font.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontCache.cpp" />
</span><del>- <ClCompile Include="..\platform\graphics\FontData.cpp" />
</del><span class="cx"> <ClCompile Include="..\platform\graphics\FontDescription.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontGenericFamilies.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontGlyphs.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontFastPath.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontFeatureSettings.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\FontPlatformData.cpp" />
</span><ins>+ <ClCompile Include="..\platform\graphics\FontRanges.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\graphics\GeometryUtilities.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\GeneratedImage.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\Gradient.cpp" />
</span><span class="lines">@@ -8020,7 +8020,6 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\PlatformTimeRanges.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\Region.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\RoundedRect.cpp" />
</span><del>- <ClCompile Include="..\platform\graphics\SegmentedFontData.cpp" />
</del><span class="cx"> <ClCompile Include="..\platform\graphics\ShadowBlur.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\SimpleFontData.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\TextRun.cpp" />
</span><span class="lines">@@ -19469,13 +19468,13 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FloatSizeHash.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\Font.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontCache.h" />
</span><del>- <ClInclude Include="..\platform\graphics\FontData.h" />
</del><span class="cx"> <ClInclude Include="..\platform\graphics\FontDescription.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontGenericFamilies.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontGlyphs.h" />
</span><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><ins>+ <ClInclude Include="..\platform\graphics\FontRanges.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\graphics\FontRenderingMode.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontSelector.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\FontSmoothingMode.h" />
</span><span class="lines">@@ -19518,7 +19517,6 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\PlatformTimeRanges.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\Region.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\RoundedRect.h" />
</span><del>- <ClInclude Include="..\platform\graphics\SegmentedFontData.h" />
</del><span class="cx"> <ClInclude Include="..\platform\graphics\ShadowBlur.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\SimpleFontData.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\TextRun.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -1352,10 +1352,8 @@
</span><span class="cx">                 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */; };
</span><span class="cx">                 371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 371E65CB13661EDC00BEEDB0 /* PageSerializer.h */; };
</span><span class="cx">                 371E65CE13661EED00BEEDB0 /* PageSerializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */; };
</span><del>-                371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; };
-                371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */; };
-                371F4FFD0D25E7F300ECE0D5 /* SegmentedFontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4FFB0D25E7F300ECE0D5 /* SegmentedFontData.cpp */; };
</del><ins>+                371F4FFC0D25E7F300ECE0D5 /* FontRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4FFA0D25E7F300ECE0D5 /* FontRanges.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                371F4FFD0D25E7F300ECE0D5 /* FontRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4FFB0D25E7F300ECE0D5 /* FontRanges.cpp */; };
</ins><span class="cx">                 371F51A10D262FA000ECE0D5 /* CSSSegmentedFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F519F0D262FA000ECE0D5 /* CSSSegmentedFontFace.h */; };
</span><span class="cx">                 371F51A20D262FA000ECE0D5 /* CSSSegmentedFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F51A00D262FA000ECE0D5 /* CSSSegmentedFontFace.cpp */; };
</span><span class="cx">                 371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */; };
</span><span class="lines">@@ -8390,10 +8388,8 @@
</span><span class="cx">                 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HyphenationCF.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 371E65CB13661EDC00BEEDB0 /* PageSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageSerializer.h; sourceTree = "<group>"; };
</span><span class="cx">                 371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageSerializer.cpp; sourceTree = "<group>"; };
</span><del>-                371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; };
-                371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; };
-                371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentedFontData.h; sourceTree = "<group>"; };
-                371F4FFB0D25E7F300ECE0D5 /* SegmentedFontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SegmentedFontData.cpp; sourceTree = "<group>"; };
</del><ins>+                371F4FFA0D25E7F300ECE0D5 /* FontRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontRanges.h; sourceTree = "<group>"; };
+                371F4FFB0D25E7F300ECE0D5 /* FontRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontRanges.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 371F519F0D262FA000ECE0D5 /* CSSSegmentedFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSegmentedFontFace.h; sourceTree = "<group>"; };
</span><span class="cx">                 371F51A00D262FA000ECE0D5 /* CSSSegmentedFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSSegmentedFontFace.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSUnicodeRangeValue.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -20439,8 +20435,6 @@
</span><span class="cx">                                 BCB92D4E1293550B00C8387F /* FontBaseline.h */,
</span><span class="cx">                                 B2C3DA510D006CD600EF6F26 /* FontCache.cpp */,
</span><span class="cx">                                 B2C3DA520D006CD600EF6F26 /* FontCache.h */,
</span><del>-                                371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */,
-                                371F4F3E0D25B9AF00ECE0D5 /* FontData.h */,
</del><span class="cx">                                 37ACCE620DA2AA960089E602 /* FontDescription.cpp */,
</span><span class="cx">                                 B2C3DA550D006CD600EF6F26 /* FontDescription.h */,
</span><span class="cx">                                 72626E010EF022FE00A07E20 /* FontFastPath.cpp */,
</span><span class="lines">@@ -20543,8 +20537,8 @@
</span><span class="cx">                                 BCAB418013E356E800D8AAF3 /* Region.h */,
</span><span class="cx">                                 A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */,
</span><span class="cx">                                 A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */,
</span><del>-                                371F4FFB0D25E7F300ECE0D5 /* SegmentedFontData.cpp */,
-                                371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */,
</del><ins>+                                371F4FFB0D25E7F300ECE0D5 /* FontRanges.cpp */,
+                                371F4FFA0D25E7F300ECE0D5 /* FontRanges.h */,
</ins><span class="cx">                                 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */,
</span><span class="cx">                                 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */,
</span><span class="cx">                                 B2C3DA530D006CD600EF6F26 /* SimpleFontData.cpp */,
</span><span class="lines">@@ -24309,7 +24303,6 @@
</span><span class="cx">                                 BCB92D4F1293550B00C8387F /* FontBaseline.h in Headers */,
</span><span class="cx">                                 B2C3DA630D006CD600EF6F26 /* FontCache.h in Headers */,
</span><span class="cx">                                 B2AFFC7E0D00A5C10030074D /* FontCustomPlatformData.h in Headers */,
</span><del>-                                371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */,
</del><span class="cx">                                 B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */,
</span><span class="cx">                                 4A6E9FC813C17D570046A7F8 /* FontFeatureSettings.h in Headers */,
</span><span class="cx">                                 B2C3DA680D006CD600EF6F26 /* FontGlyphs.h in Headers */,
</span><span class="lines">@@ -25960,7 +25953,7 @@
</span><span class="cx">                                 BCD0E0FC0E972C3500265DEA /* SecurityOriginHash.h in Headers */,
</span><span class="cx">                                 974D2DA5146A535D00D51F8B /* SecurityPolicy.h in Headers */,
</span><span class="cx">                                 2D5BC42716F882EE007048D0 /* SecurityPolicyViolationEvent.h in Headers */,
</span><del>-                                371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */,
</del><ins>+                                371F4FFC0D25E7F300ECE0D5 /* FontRanges.h in Headers */,
</ins><span class="cx">                                 99CC0B5E18BE984A006CEBCC /* SegmentedInputStorage.h in Headers */,
</span><span class="cx">                                 B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */,
</span><span class="cx">                                 BEA807C90F714A0300524199 /* SelectionRect.h in Headers */,
</span><span class="lines">@@ -27813,7 +27806,6 @@
</span><span class="cx">                                 B2AFFC7C0D00A5C10030074D /* FontCacheMac.mm in Sources */,
</span><span class="cx">                                 37C2360B1097EDED00EF9F72 /* FontComplexTextMac.cpp in Sources */,
</span><span class="cx">                                 B2AFFC7D0D00A5C10030074D /* FontCustomPlatformData.cpp in Sources */,
</span><del>-                                371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */,
</del><span class="cx">                                 37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */,
</span><span class="cx">                                 72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */,
</span><span class="cx">                                 4A6E9FC713C17D570046A7F8 /* FontFeatureSettings.cpp in Sources */,
</span><span class="lines">@@ -29391,7 +29383,7 @@
</span><span class="cx">                                 976F36EA14686225005E93B4 /* SecurityContext.cpp in Sources */,
</span><span class="cx">                                 BCD0E0FA0E972C3500265DEA /* SecurityOrigin.cpp in Sources */,
</span><span class="cx">                                 974D2DA4146A535D00D51F8B /* SecurityPolicy.cpp in Sources */,
</span><del>-                                371F4FFD0D25E7F300ECE0D5 /* SegmentedFontData.cpp in Sources */,
</del><ins>+                                371F4FFD0D25E7F300ECE0D5 /* FontRanges.cpp in Sources */,
</ins><span class="cx">                                 99CC0B5D18BE984A006CEBCC /* SegmentedInputStorage.cpp in Sources */,
</span><span class="cx">                                 B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */,
</span><span class="cx">                                 BEA807C80F714A0300524199 /* SelectionRect.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -468,7 +468,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
</del><ins>+FontRanges CSSFontSelector::fontRangesForFamily(const FontDescription& fontDescription, const AtomicString& familyName)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: The spec (and Firefox) says user specified generic families (sans-serif etc.) should be resolved before the @font-face lookup too.
</span><span class="cx"> bool resolveGenericFamilyFirst = familyName == standardFamily;
</span><span class="lines">@@ -478,10 +478,10 @@
</span><span class="cx"> if (!face) {
</span><span class="cx"> if (!resolveGenericFamilyFirst)
</span><span class="cx"> familyForLookup = resolveGenericFamily(m_document, fontDescription, familyName);
</span><del>- return fontCache().fontForFamily(fontDescription, familyForLookup);
</del><ins>+ return FontRanges(fontCache().fontForFamily(fontDescription, familyForLookup));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return face->getFontData(fontDescription);
</del><ins>+ return face->fontRanges(fontDescription);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDescription, const AtomicString& family)
</span><span class="lines">@@ -623,7 +623,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<FontData> CSSFontSelector::getFallbackFontData(const FontDescription& fontDescription, size_t index)
</del><ins>+PassRefPtr<SimpleFontData> CSSFontSelector::fallbackFontDataAt(const FontDescription& fontDescription, size_t index)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT_UNUSED(index, !index);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/css/CSSFontSelector.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx"> virtual unsigned version() const override { return m_version; }
</span><span class="cx"> virtual unsigned uniqueId() const override { return m_uniqueId; }
</span><span class="cx">
</span><del>- virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString&) override;
</del><ins>+ virtual FontRanges fontRangesForFamily(const FontDescription&, const AtomicString&) override;
</ins><span class="cx"> virtual size_t fallbackFontDataCount() override;
</span><del>- virtual PassRefPtr<FontData> getFallbackFontData(const FontDescription&, size_t) override;
</del><ins>+ virtual PassRefPtr<SimpleFontData> fallbackFontDataAt(const FontDescription&, size_t) override;
</ins><span class="cx"> CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString& family);
</span><span class="cx">
</span><span class="cx"> virtual bool resolvesFamilyFor(const FontDescription&) const override;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSegmentedFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "FontDescription.h"
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><del>-#include "SegmentedFontData.h"
</del><span class="cx"> #include "SimpleFontData.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -52,11 +51,7 @@
</span><span class="cx">
</span><span class="cx"> void CSSSegmentedFontFace::pruneTable()
</span><span class="cx"> {
</span><del>- // Make sure the glyph page tree prunes out all uses of this custom font.
- if (m_fontDataTable.isEmpty())
- return;
-
- m_fontDataTable.clear();
</del><ins>+ m_descriptionToRangesMap.clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSSegmentedFontFace::isValid() const
</span><span class="lines">@@ -95,28 +90,27 @@
</span><span class="cx"> m_fontFaces.append(fontFace);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void appendFontDataWithInvalidUnicodeRangeIfLoading(SegmentedFontData* newFontData, PassRefPtr<SimpleFontData> prpFaceFontData, const Vector<CSSFontFace::UnicodeRange>& ranges)
</del><ins>+static void appendFontDataWithInvalidUnicodeRangeIfLoading(FontRanges& ranges, Ref<SimpleFontData>&& fontData, const Vector<CSSFontFace::UnicodeRange>& unicodeRanges)
</ins><span class="cx"> {
</span><del>- RefPtr<SimpleFontData> faceFontData = prpFaceFontData;
- if (faceFontData->isLoading()) {
- newFontData->appendRange(FontDataRange(0, 0, faceFontData));
</del><ins>+ if (fontData->isLoading()) {
+ ranges.appendRange(FontRanges::Range(0, 0, WTF::move(fontData)));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- unsigned numRanges = ranges.size();
</del><ins>+ unsigned numRanges = unicodeRanges.size();
</ins><span class="cx"> if (!numRanges) {
</span><del>- newFontData->appendRange(FontDataRange(0, 0x7FFFFFFF, faceFontData));
</del><ins>+ ranges.appendRange(FontRanges::Range(0, 0x7FFFFFFF, WTF::move(fontData)));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (unsigned j = 0; j < numRanges; ++j)
</span><del>- newFontData->appendRange(FontDataRange(ranges[j].from(), ranges[j].to(), faceFontData));
</del><ins>+ ranges.appendRange(FontRanges::Range(unicodeRanges[j].from(), unicodeRanges[j].to(), fontData.copyRef()));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<FontData> CSSSegmentedFontFace::getFontData(const FontDescription& fontDescription)
</del><ins>+FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescription)
</ins><span class="cx"> {
</span><span class="cx"> if (!isValid())
</span><del>- return 0;
</del><ins>+ return FontRanges();
</ins><span class="cx">
</span><span class="cx"> FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
</span><span class="cx"> unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + FontWidthVariantWidth + 1))
</span><span class="lines">@@ -124,37 +118,28 @@
</span><span class="cx"> | fontDescription.widthVariant() << FontTraitsMaskWidth
</span><span class="cx"> | desiredTraitsMask;
</span><span class="cx">
</span><del>- RefPtr<SegmentedFontData>& fontData = m_fontDataTable.add(hashKey, nullptr).iterator->value;
- if (fontData && fontData->numRanges())
- return fontData; // No release, we have a reference to an object in the cache which should retain the ref count it has.
</del><ins>+ auto addResult = m_descriptionToRangesMap.add(hashKey, FontRanges());
+ auto& fontRanges = addResult.iterator->value;
</ins><span class="cx">
</span><del>- if (!fontData)
- fontData = SegmentedFontData::create();
-
- unsigned size = m_fontFaces.size();
- for (unsigned i = 0; i < size; i++) {
- if (!m_fontFaces[i]->isValid())
- continue;
- FontTraitsMask traitsMask = m_fontFaces[i]->traitsMask();
- bool syntheticBold = !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
- bool syntheticItalic = !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask);
- if (RefPtr<SimpleFontData> faceFontData = m_fontFaces[i]->getFontData(fontDescription, syntheticBold, syntheticItalic)) {
- ASSERT(!faceFontData->isSegmented());
- appendFontDataWithInvalidUnicodeRangeIfLoading(fontData.get(), faceFontData.release(), m_fontFaces[i]->ranges());
</del><ins>+ if (addResult.isNewEntry) {
+ for (auto& face : m_fontFaces) {
+ if (!face->isValid())
+ continue;
+ FontTraitsMask traitsMask = face->traitsMask();
+ bool syntheticBold = !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
+ bool syntheticItalic = !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask);
+ if (RefPtr<SimpleFontData> faceFontData = face->getFontData(fontDescription, syntheticBold, syntheticItalic))
+ appendFontDataWithInvalidUnicodeRangeIfLoading(fontRanges, faceFontData.releaseNonNull(), face->ranges());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>- if (fontData->numRanges())
- return fontData; // No release, we have a reference to an object in the cache which should retain the ref count it has.
-
- return 0;
</del><ins>+ return fontRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="cx"> bool CSSSegmentedFontFace::isLoading() const
</span><span class="cx"> {
</span><del>- unsigned size = m_fontFaces.size();
- for (unsigned i = 0; i < size; i++) {
- if (m_fontFaces[i]->loadState() == CSSFontFace::Loading)
</del><ins>+ for (auto& face : m_fontFaces) {
+ if (face->loadState() == CSSFontFace::Loading)
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="lines">@@ -162,9 +147,8 @@
</span><span class="cx">
</span><span class="cx"> bool CSSSegmentedFontFace::checkFont() const
</span><span class="cx"> {
</span><del>- unsigned size = m_fontFaces.size();
- for (unsigned i = 0; i < size; i++) {
- if (m_fontFaces[i]->loadState() != CSSFontFace::Loaded)
</del><ins>+ for (auto& face : m_fontFaces) {
+ if (face->loadState() != CSSFontFace::Loaded)
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="lines">@@ -172,7 +156,7 @@
</span><span class="cx">
</span><span class="cx"> void CSSSegmentedFontFace::loadFont(const FontDescription& fontDescription, PassRefPtr<LoadFontCallback> callback)
</span><span class="cx"> {
</span><del>- getFontData(fontDescription); // Kick off the load.
</del><ins>+ fontRanges(fontDescription); // Kick off the load.
</ins><span class="cx">
</span><span class="cx"> if (callback) {
</span><span class="cx"> if (isLoading())
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSegmentedFontFaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSegmentedFontFace.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSegmentedFontFace.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/css/CSSSegmentedFontFace.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef CSSSegmentedFontFace_h
</span><span class="cx"> #define CSSSegmentedFontFace_h
</span><span class="cx">
</span><ins>+#include "FontRanges.h"
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="lines">@@ -35,9 +36,7 @@
</span><span class="cx">
</span><span class="cx"> class CSSFontFace;
</span><span class="cx"> class CSSFontSelector;
</span><del>-class FontData;
</del><span class="cx"> class FontDescription;
</span><del>-class SegmentedFontData;
</del><span class="cx">
</span><span class="cx"> class CSSSegmentedFontFace : public RefCounted<CSSSegmentedFontFace> {
</span><span class="cx"> public:
</span><span class="lines">@@ -50,7 +49,7 @@
</span><span class="cx">
</span><span class="cx"> void appendFontFace(PassRefPtr<CSSFontFace>);
</span><span class="cx">
</span><del>- PassRefPtr<FontData> getFontData(const FontDescription&);
</del><ins>+ FontRanges fontRanges(const FontDescription&);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="cx"> class LoadFontCallback : public RefCounted<LoadFontCallback> {
</span><span class="lines">@@ -74,7 +73,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> CSSFontSelector* m_fontSelector;
</span><del>- HashMap<unsigned, RefPtr<SegmentedFontData>> m_fontDataTable;
</del><ins>+ HashMap<unsigned, FontRanges> m_descriptionToRangesMap;
</ins><span class="cx"> Vector<RefPtr<CSSFontFace>, 1> m_fontFaces;
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="cx"> Vector<RefPtr<LoadFontCallback>> m_callbacks;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/Font.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> int emphasisMarkHeight(const AtomicString&) const;
</span><span class="cx">
</span><span class="cx"> const SimpleFontData& primaryFontData() const;
</span><del>- const FontData* fontDataAt(unsigned) const;
</del><ins>+ const FontRanges& fallbackRangesAt(unsigned) const;
</ins><span class="cx"> GlyphData glyphDataForCharacter(UChar32, bool mirror, FontDataVariant = AutoVariant) const;
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -357,10 +357,10 @@
</span><span class="cx"> return m_glyphs->primarySimpleFontData(m_fontDescription);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline const FontData* Font::fontDataAt(unsigned index) const
</del><ins>+inline const FontRanges& Font::fallbackRangesAt(unsigned index) const
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_glyphs);
</span><del>- return m_glyphs->realizeFontDataAt(m_fontDescription, index);
</del><ins>+ return m_glyphs->realizeFallbackRangesAt(m_fontDescription, index);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool Font::isFixedPitch() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDatacpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/FontData.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontData.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/FontData.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
- * 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 "FontData.h"
-
-namespace WebCore {
-
-FontData::~FontData()
-{
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDatah"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/FontData.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontData.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/FontData.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
- * 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.
- */
-
-#ifndef FontData_h
-#define FontData_h
-
-#include <unicode/utypes.h>
-#include <wtf/FastMalloc.h>
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class SimpleFontData;
-
-class FontData : public RefCounted<FontData> {
- WTF_MAKE_NONCOPYABLE(FontData); WTF_MAKE_FAST_ALLOCATED;
-public:
- FontData()
- {
- }
-
- virtual ~FontData();
-
- virtual const SimpleFontData* simpleFontDataForCharacter(UChar32) const = 0;
- virtual const SimpleFontData& simpleFontDataForFirstRange() const = 0;
- virtual bool isCustomFont() const = 0;
- virtual bool isLoading() const = 0;
- virtual bool isSegmented() const = 0;
-
-#ifndef NDEBUG
- virtual String description() const = 0;
-#endif
-};
-
-} // namespace WebCore
-
-#endif // FontData_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "Font.h"
</span><span class="cx"> #include "FontCache.h"
</span><span class="cx"> #include "GlyphPage.h"
</span><del>-#include "SegmentedFontData.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -52,7 +51,7 @@
</span><span class="cx"> , m_generation(fontCache().generation())
</span><span class="cx"> , m_isForPlatformFont(true)
</span><span class="cx"> {
</span><del>- m_realizedFontData.append(fontCache().fontForPlatformData(platformData));
</del><ins>+ m_realizedFallbackRanges.append(FontRanges(fontCache().fontForPlatformData(platformData)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FontGlyphs::~FontGlyphs()
</span><span class="lines">@@ -61,29 +60,24 @@
</span><span class="cx">
</span><span class="cx"> void FontGlyphs::determinePitch(const FontDescription& description)
</span><span class="cx"> {
</span><del>- const FontData& fontData = *realizeFontDataAt(description, 0);
- if (is<SimpleFontData>(fontData))
- m_pitch = downcast<SimpleFontData>(fontData).pitch();
- else {
- const SegmentedFontData& segmentedFontData = downcast<SegmentedFontData>(fontData);
- unsigned numRanges = segmentedFontData.numRanges();
- if (numRanges == 1)
- m_pitch = segmentedFontData.rangeAt(0).fontData()->pitch();
- else
- m_pitch = VariablePitch;
- }
</del><ins>+ auto& primaryRanges = realizeFallbackRangesAt(description, 0);
+ unsigned numRanges = primaryRanges.size();
+ if (numRanges == 1)
+ m_pitch = primaryRanges.rangeAt(0).fontData().pitch();
+ else
+ m_pitch = VariablePitch;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool FontGlyphs::isLoadingCustomFonts() const
</span><span class="cx"> {
</span><del>- for (auto& font : m_realizedFontData) {
- if (font->isLoading())
</del><ins>+ for (auto& fontRanges : m_realizedFallbackRanges) {
+ if (fontRanges.isLoading())
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RefPtr<FontData> realizeNextFamily(const FontDescription& description, unsigned& index, FontSelector* fontSelector)
</del><ins>+static FontRanges realizeNextFallback(const FontDescription& description, unsigned& index, FontSelector* fontSelector)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(index < description.familyCount());
</span><span class="cx">
</span><span class="lines">@@ -92,55 +86,53 @@
</span><span class="cx"> if (family.isEmpty())
</span><span class="cx"> continue;
</span><span class="cx"> if (fontSelector) {
</span><del>- if (auto font = fontSelector->getFontData(description, family))
- return font;
</del><ins>+ auto ranges = fontSelector->fontRangesForFamily(description, family);
+ if (!ranges.isNull())
+ return ranges;
</ins><span class="cx"> }
</span><span class="cx"> if (auto font = fontCache().fontForFamily(description, family))
</span><del>- return font;
</del><ins>+ return FontRanges(WTF::move(font));
</ins><span class="cx"> }
</span><span class="cx"> // We didn't find a font. Try to find a similar font using our own specific knowledge about our platform.
</span><span class="cx"> // For example on OS X, we know to map any families containing the words Arabic, Pashto, or Urdu to the
</span><span class="cx"> // Geeza Pro font.
</span><del>- return fontCache().similarFontPlatformData(description);
</del><ins>+ return FontRanges(fontCache().similarFontPlatformData(description));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-const FontData* FontGlyphs::realizeFontDataAt(const FontDescription& description, unsigned index)
</del><ins>+const FontRanges& FontGlyphs::realizeFallbackRangesAt(const FontDescription& description, unsigned index)
</ins><span class="cx"> {
</span><del>- if (index < m_realizedFontData.size())
- return &m_realizedFontData[index].get();
</del><ins>+ if (index < m_realizedFallbackRanges.size())
+ return m_realizedFallbackRanges[index];
</ins><span class="cx">
</span><del>- ASSERT(index == m_realizedFontData.size());
</del><ins>+ ASSERT(index == m_realizedFallbackRanges.size());
</ins><span class="cx"> ASSERT(fontCache().generation() == m_generation);
</span><span class="cx">
</span><del>- if (!index) {
- RefPtr<FontData> result = realizeNextFamily(description, m_lastRealizedFamilyIndex, m_fontSelector.get());
- if (!result && m_fontSelector)
- result = m_fontSelector->getFontData(description, standardFamily);
- if (!result)
- result = fontCache().lastResortFallbackFont(description);
</del><ins>+ m_realizedFallbackRanges.append(FontRanges());
+ auto& fontRanges = m_realizedFallbackRanges.last();
</ins><span class="cx">
</span><del>- m_realizedFontData.append(*result);
- return result.get();
</del><ins>+ 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().lastResortFallbackFont(description));
+ return fontRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<FontData> result;
- if (m_lastRealizedFamilyIndex < description.familyCount())
- result = realizeNextFamily(description, m_lastRealizedFamilyIndex, m_fontSelector.get());
</del><ins>+ if (m_lastRealizedFallbackIndex < description.familyCount())
+ fontRanges = realizeNextFallback(description, m_lastRealizedFallbackIndex, m_fontSelector.get());
</ins><span class="cx">
</span><del>- if (!result && m_fontSelector) {
- ASSERT(m_lastRealizedFamilyIndex >= description.familyCount());
</del><ins>+ if (fontRanges.isNull() && m_fontSelector) {
+ ASSERT(m_lastRealizedFallbackIndex >= description.familyCount());
</ins><span class="cx">
</span><del>- unsigned fontSelectorFallbackIndex = m_lastRealizedFamilyIndex - description.familyCount();
</del><ins>+ unsigned fontSelectorFallbackIndex = m_lastRealizedFallbackIndex - description.familyCount();
</ins><span class="cx"> if (fontSelectorFallbackIndex == m_fontSelector->fallbackFontDataCount())
</span><del>- return nullptr;
- ++m_lastRealizedFamilyIndex;
- result = m_fontSelector->getFallbackFontData(description, fontSelectorFallbackIndex);
</del><ins>+ return fontRanges;
+ ++m_lastRealizedFallbackIndex;
+ fontRanges = FontRanges(m_fontSelector->fallbackFontDataAt(description, fontSelectorFallbackIndex));
</ins><span class="cx"> }
</span><del>- if (!result)
- return nullptr;
</del><span class="cx">
</span><del>- m_realizedFontData.append(*result);
- return result.get();
</del><ins>+ return fontRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
</span><span class="lines">@@ -263,10 +255,10 @@
</span><span class="cx"> GlyphData FontGlyphs::glyphDataForSystemFallback(UChar32 c, const FontDescription& description, FontDataVariant variant)
</span><span class="cx"> {
</span><span class="cx"> // System fallback is character-dependent.
</span><del>- auto& primaryFontData = *realizeFontDataAt(description, 0);
- auto* originalFontData = primaryFontData.simpleFontDataForCharacter(c);
</del><ins>+ auto& primaryRanges = realizeFallbackRangesAt(description, 0);
+ auto* originalFontData = primaryRanges.fontDataForCharacter(c);
</ins><span class="cx"> if (!originalFontData)
</span><del>- originalFontData = &primaryFontData.simpleFontDataForFirstRange();
</del><ins>+ originalFontData = &primaryRanges.fontDataForFirstRange();
</ins><span class="cx">
</span><span class="cx"> RefPtr<SimpleFontData> systemFallbackFontData = originalFontData->systemFallbackFontDataForCharacter(c, description, m_isForPlatformFont);
</span><span class="cx"> if (!systemFallbackFontData)
</span><span class="lines">@@ -295,9 +287,12 @@
</span><span class="cx">
</span><span class="cx"> GlyphData FontGlyphs::glyphDataForVariant(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned fallbackIndex)
</span><span class="cx"> {
</span><del>- while (auto* fontData = realizeFontDataAt(description, fallbackIndex++)) {
- auto* simpleFontData = fontData->simpleFontDataForCharacter(c);
- GlyphData data = simpleFontData ? simpleFontData->glyphDataForCharacter(c) : GlyphData();
</del><ins>+ while (true) {
+ auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
+ if (fontRanges.isNull())
+ break;
+ auto* fontData = fontRanges.fontDataForCharacter(c);
+ GlyphData data = fontData ? fontData->glyphDataForCharacter(c) : GlyphData();
</ins><span class="cx"> if (data.fontData) {
</span><span class="cx"> // The variantFontData function should not normally return 0.
</span><span class="cx"> // But if it does, we will just render the capital letter big.
</span><span class="lines">@@ -316,8 +311,11 @@
</span><span class="cx"> {
</span><span class="cx"> const unsigned pageNumber = c / GlyphPage::size;
</span><span class="cx">
</span><del>- for (unsigned fallbackIndex = 0; auto* fontData = realizeFontDataAt(description, fallbackIndex); ++fallbackIndex) {
- auto* simpleFontData = fontData->simpleFontDataForCharacter(c);
</del><ins>+ for (unsigned fallbackIndex = 0; true; ++fallbackIndex) {
+ auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
+ if (fontRanges.isNull())
+ break;
+ auto* simpleFontData = fontRanges.fontDataForCharacter(c);
</ins><span class="cx"> auto* page = simpleFontData ? simpleFontData->glyphPage(pageNumber) : nullptr;
</span><span class="cx"> if (!page)
</span><span class="cx"> continue;
</span><span class="lines">@@ -345,25 +343,21 @@
</span><span class="cx"> return glyphDataForSystemFallback(c, description, NormalVariant);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RefPtr<GlyphPage> glyphPageFromFontData(unsigned pageNumber, const FontData& fontData)
</del><ins>+static RefPtr<GlyphPage> glyphPageFromFontRanges(unsigned pageNumber, const FontRanges& fontRanges)
</ins><span class="cx"> {
</span><span class="cx"> const SimpleFontData* simpleFontData = nullptr;
</span><del>- if (fontData.isSegmented()) {
- UChar32 pageRangeFrom = pageNumber * GlyphPage::size;
- UChar32 pageRangeTo = pageRangeFrom + GlyphPage::size - 1;
- auto& segmentedFontData = downcast<SegmentedFontData>(fontData);
- for (unsigned i = 0; i < segmentedFontData.numRanges(); ++i) {
- auto& range = segmentedFontData.rangeAt(i);
- if (range.to()) {
- if (range.from() <= pageRangeFrom && pageRangeTo <= range.to())
- simpleFontData = range.fontData().get();
- break;
- }
</del><ins>+ 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())
+ simpleFontData = &range.fontData();
+ break;
</ins><span class="cx"> }
</span><del>- if (!simpleFontData)
- return nullptr;
- } else
- simpleFontData = &downcast<SimpleFontData>(fontData);
</del><ins>+ }
+ if (!simpleFontData)
+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> if (simpleFontData->platformData().orientation() == Vertical)
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -383,7 +377,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<GlyphPage>& cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator->value : m_cachedPageZero;
</span><span class="cx"> if (!cachedPage)
</span><del>- cachedPage = glyphPageFromFontData(pageNumber, *realizeFontDataAt(description, 0));
</del><ins>+ cachedPage = glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0));
</ins><span class="cx">
</span><span class="cx"> GlyphData glyphData = cachedPage ? cachedPage->glyphDataForCharacter(c) : GlyphData();
</span><span class="cx"> if (!glyphData.glyph) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> #ifndef FontGlyphs_h
</span><span class="cx"> #define FontGlyphs_h
</span><span class="cx">
</span><ins>+#include "FontRanges.h"
</ins><span class="cx"> #include "FontSelector.h"
</span><span class="cx"> #include "GlyphPage.h"
</span><span class="cx"> #include "SimpleFontData.h"
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx"> const WidthCache& widthCache() const { return m_widthCache; }
</span><span class="cx">
</span><span class="cx"> const SimpleFontData& primarySimpleFontData(const FontDescription&);
</span><del>- WEBCORE_EXPORT const FontData* realizeFontDataAt(const FontDescription&, unsigned index);
</del><ins>+ WEBCORE_EXPORT const FontRanges& realizeFallbackRangesAt(const FontDescription&, unsigned fallbackIndex);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> FontGlyphs(PassRefPtr<FontSelector>);
</span><span class="lines">@@ -76,7 +77,8 @@
</span><span class="cx"> GlyphData glyphDataForNormalVariant(UChar32, const FontDescription&);
</span><span class="cx"> GlyphData glyphDataForVariant(UChar32, const FontDescription&, FontDataVariant, unsigned fallbackIndex);
</span><span class="cx">
</span><del>- Vector<Ref<FontData>, 1> m_realizedFontData;
</del><ins>+ Vector<FontRanges, 1> m_realizedFallbackRanges;
+ unsigned m_lastRealizedFallbackIndex { 0 };
</ins><span class="cx">
</span><span class="cx"> RefPtr<GlyphPage> m_cachedPageZero;
</span><span class="cx"> HashMap<int, RefPtr<GlyphPage>> m_cachedPages;
</span><span class="lines">@@ -85,10 +87,11 @@
</span><span class="cx">
</span><span class="cx"> const SimpleFontData* m_cachedPrimarySimpleFontData;
</span><span class="cx"> RefPtr<FontSelector> m_fontSelector;
</span><ins>+
</ins><span class="cx"> WidthCache m_widthCache;
</span><ins>+
</ins><span class="cx"> unsigned m_fontSelectorVersion;
</span><span class="cx"> unsigned short m_generation;
</span><del>- unsigned m_lastRealizedFamilyIndex { 0 };
</del><span class="cx"> Pitch m_pitch { UnknownPitch };
</span><span class="cx"> bool m_isForPlatformFont { false };
</span><span class="cx"> };
</span><span class="lines">@@ -104,10 +107,10 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> if (!m_cachedPrimarySimpleFontData) {
</span><del>- auto& fontData = *realizeFontDataAt(description, 0);
- m_cachedPrimarySimpleFontData = fontData.simpleFontDataForCharacter(' ');
</del><ins>+ auto& primaryRanges = realizeFallbackRangesAt(description, 0);
+ m_cachedPrimarySimpleFontData = primaryRanges.fontDataForCharacter(' ');
</ins><span class="cx"> if (!m_cachedPrimarySimpleFontData)
</span><del>- m_cachedPrimarySimpleFontData = &fontData.simpleFontDataForFirstRange();
</del><ins>+ m_cachedPrimarySimpleFontData = &primaryRanges.fontDataForFirstRange();
</ins><span class="cx"> }
</span><span class="cx"> return *m_cachedPrimarySimpleFontData;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontRangescppfromrev178362trunkSourceWebCoreplatformgraphicsSegmentedFontDatacpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/FontRanges.cpp (from rev 178362, trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp) (0 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontRanges.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/FontRanges.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2009, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 "FontRanges.h"
+
+#include "SimpleFontData.h"
+#include <wtf/Assertions.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+FontRanges::FontRanges()
+{
+}
+
+FontRanges::FontRanges(RefPtr<SimpleFontData>&& fontData)
+{
+ if (fontData)
+ m_ranges.append(Range { 0, 0x7FFFFFFF, fontData.releaseNonNull() });
+}
+
+FontRanges::~FontRanges()
+{
+}
+
+const SimpleFontData* FontRanges::fontDataForCharacter(UChar32 c) const
+{
+ for (auto& range : m_ranges) {
+ if (range.from() <= c && c <= range.to())
+ return &range.fontData();
+ }
+ return nullptr;
+}
+
+const SimpleFontData& FontRanges::fontDataForFirstRange() const
+{
+ return m_ranges[0].fontData();
+}
+
+bool FontRanges::isLoading() const
+{
+ for (auto& range : m_ranges) {
+ if (range.fontData().isLoading())
+ return true;
+ }
+ return false;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontRangeshfromrev178362trunkSourceWebCoreplatformgraphicsSegmentedFontDatah"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/FontRanges.h (from rev 178362, trunk/Source/WebCore/platform/graphics/SegmentedFontData.h) (0 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontRanges.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/FontRanges.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2009, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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.
+ */
+
+#ifndef FontRanges_h
+#define FontRanges_h
+
+#include "SimpleFontData.h"
+#include <wtf/TypeCasts.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class FontRanges {
+public:
+ struct Range {
+ Range(UChar32 from, UChar32 to, Ref<SimpleFontData>&& fontData)
+ : m_from(from)
+ , m_to(to)
+ , m_fontData(WTF::move(fontData))
+ {
+ }
+
+ UChar32 from() const { return m_from; }
+ UChar32 to() const { return m_to; }
+ const SimpleFontData& fontData() const { return *m_fontData; }
+
+ private:
+ UChar32 m_from;
+ UChar32 m_to;
+ RefPtr<SimpleFontData> m_fontData;
+ };
+
+ FontRanges();
+ explicit FontRanges(RefPtr<SimpleFontData>&&);
+ ~FontRanges();
+
+ bool isNull() const { return m_ranges.isEmpty(); }
+
+ void appendRange(const Range& range) { m_ranges.append(range); }
+ unsigned size() const { return m_ranges.size(); }
+ const Range& rangeAt(unsigned i) const { return m_ranges[i]; }
+
+ const SimpleFontData* fontDataForCharacter(UChar32) const;
+ const SimpleFontData& fontDataForFirstRange() const;
+ bool isLoading() const;
+
+private:
+ Vector<Range, 1> m_ranges;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontSelector.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontSelector.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/FontSelector.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -26,13 +26,13 @@
</span><span class="cx"> #ifndef FontSelector_h
</span><span class="cx"> #define FontSelector_h
</span><span class="cx">
</span><ins>+#include "FontRanges.h"
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class FontData;
</del><span class="cx"> class FontDescription;
</span><span class="cx"> class FontSelectorClient;
</span><span class="cx">
</span><span class="lines">@@ -40,9 +40,8 @@
</span><span class="cx"> public:
</span><span class="cx"> virtual ~FontSelector() { }
</span><span class="cx">
</span><del>- // FIXME: Remove the "get" prefix from these two member functions
- virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString& familyName) = 0;
- virtual PassRefPtr<FontData> getFallbackFontData(const FontDescription&, size_t) = 0;
</del><ins>+ virtual FontRanges fontRangesForFamily(const FontDescription&, const AtomicString&) = 0;
+ virtual PassRefPtr<SimpleFontData> fallbackFontDataAt(const FontDescription&, size_t) = 0;
</ins><span class="cx">
</span><span class="cx"> virtual size_t fallbackFontDataCount() = 0;
</span><span class="cx"> virtual bool resolvesFamilyFor(const FontDescription&) const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSegmentedFontDatacpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2009, 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
- * 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 "SegmentedFontData.h"
-
-#include "SimpleFontData.h"
-#include <wtf/Assertions.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-SegmentedFontData::SegmentedFontData()
-{
-
-}
-
-SegmentedFontData::~SegmentedFontData()
-{
-}
-
-const SimpleFontData* SegmentedFontData::simpleFontDataForCharacter(UChar32 c) const
-{
- for (auto& range : m_ranges) {
- if (range.from() <= c && c <= range.to())
- return range.fontData().get();
- }
- return nullptr;
-}
-
-const SimpleFontData& SegmentedFontData::simpleFontDataForFirstRange() const
-{
- return *m_ranges[0].fontData();
-}
-
-bool SegmentedFontData::isCustomFont() const
-{
- // All segmented fonts are custom fonts.
- return true;
-}
-
-bool SegmentedFontData::isLoading() const
-{
- for (auto& range : m_ranges) {
- if (range.fontData()->isLoading())
- return true;
- }
- return false;
-}
-
-bool SegmentedFontData::isSegmented() const
-{
- return true;
-}
-
-#ifndef NDEBUG
-String SegmentedFontData::description() const
-{
- return "[segmented font]";
-}
-#endif
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSegmentedFontDatah"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/SegmentedFontData.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SegmentedFontData.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/SegmentedFontData.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -1,89 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2009, 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
- * 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.
- */
-
-#ifndef SegmentedFontData_h
-#define SegmentedFontData_h
-
-#include "FontData.h"
-#include <wtf/TypeCasts.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class SimpleFontData;
-
-struct FontDataRange {
- FontDataRange(UChar32 from, UChar32 to, PassRefPtr<SimpleFontData> fontData)
- : m_from(from)
- , m_to(to)
- , m_fontData(fontData)
- {
- }
-
- UChar32 from() const { return m_from; }
- UChar32 to() const { return m_to; }
- PassRefPtr<SimpleFontData> fontData() const { return m_fontData; }
-
-private:
- UChar32 m_from;
- UChar32 m_to;
- RefPtr<SimpleFontData> m_fontData;
-};
-
-class SegmentedFontData : public FontData {
-public:
- static PassRefPtr<SegmentedFontData> create() { return adoptRef(new SegmentedFontData); }
-
- virtual ~SegmentedFontData();
-
- void appendRange(const FontDataRange& range) { m_ranges.append(range); }
- unsigned numRanges() const { return m_ranges.size(); }
- const FontDataRange& rangeAt(unsigned i) const { return m_ranges[i]; }
-
-#ifndef NDEBUG
- virtual String description() const;
-#endif
-
-private:
- SegmentedFontData();
-
- virtual const SimpleFontData* simpleFontDataForCharacter(UChar32) const override;
- virtual const SimpleFontData& simpleFontDataForFirstRange() const override;
-
- virtual bool isCustomFont() const;
- virtual bool isLoading() const;
- virtual bool isSegmented() const;
-
- RefPtr<SimpleFontData> m_nullFontData;
- Vector<FontDataRange, 1> m_ranges;
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SegmentedFontData)
- static bool isType(const WebCore::FontData& fontData) { return fontData.isSegmented(); }
-SPECIALIZE_TYPE_TRAITS_END()
-
-#endif // SegmentedFontData_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSimpleFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -157,16 +157,6 @@
</span><span class="cx"> removeFromSystemFallbackCache();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const SimpleFontData* SimpleFontData::simpleFontDataForCharacter(UChar32) const
-{
- return this;
-}
-
-const SimpleFontData& SimpleFontData::simpleFontDataForFirstRange() const
-{
- return *this;
-}
-
</del><span class="cx"> static bool fillGlyphPage(GlyphPage& pageToFill, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="lines">@@ -288,11 +278,6 @@
</span><span class="cx"> return page->glyphDataForCharacter(character);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool SimpleFontData::isSegmented() const
-{
- return false;
-}
-
</del><span class="cx"> PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_derivedFontData)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSimpleFontDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.h (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SimpleFontData.h        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.h        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> #define SimpleFontData_h
</span><span class="cx">
</span><span class="cx"> #include "FontBaseline.h"
</span><del>-#include "FontData.h"
</del><span class="cx"> #include "FontMetrics.h"
</span><span class="cx"> #include "FontPlatformData.h"
</span><span class="cx"> #include "FloatRect.h"
</span><span class="lines">@@ -68,7 +67,7 @@
</span><span class="cx"> enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMarkVariant, BrokenIdeographVariant };
</span><span class="cx"> enum Pitch { UnknownPitch, FixedPitch, VariablePitch };
</span><span class="cx">
</span><del>-class SimpleFontData final : public FontData {
</del><ins>+class SimpleFontData : public RefCounted<SimpleFontData> {
</ins><span class="cx"> public:
</span><span class="cx"> class SVGData {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -92,7 +91,7 @@
</span><span class="cx"> return adoptRef(*new SimpleFontData(WTF::move(svgData), fontSize, syntheticBold, syntheticItalic));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual ~SimpleFontData();
</del><ins>+ ~SimpleFontData();
</ins><span class="cx">
</span><span class="cx"> static const SimpleFontData* systemFallback() { return reinterpret_cast<const SimpleFontData*>(-1); }
</span><span class="cx">
</span><span class="lines">@@ -178,12 +177,11 @@
</span><span class="cx"> const SVGData* svgData() const { return m_svgData.get(); }
</span><span class="cx"> bool isSVGFont() const { return !!m_svgData; }
</span><span class="cx">
</span><del>- virtual bool isCustomFont() const override { return m_isCustomFont; }
- virtual bool isLoading() const override { return m_isLoading; }
- virtual bool isSegmented() const override;
</del><ins>+ bool isCustomFont() const { return m_isCustomFont; }
+ bool isLoading() const { return m_isLoading; }
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><del>- virtual String description() const override;
</del><ins>+ String description() const;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><span class="lines">@@ -229,9 +227,6 @@
</span><span class="cx"> PassRefPtr<SimpleFontData> createScaledFontData(const FontDescription&, float scaleFactor) const;
</span><span class="cx"> PassRefPtr<SimpleFontData> platformCreateScaledFontData(const FontDescription&, float scaleFactor) const;
</span><span class="cx">
</span><del>- virtual const SimpleFontData* simpleFontDataForCharacter(UChar32) const override;
- virtual const SimpleFontData& simpleFontDataForFirstRange() const override;
-
</del><span class="cx"> void removeFromSystemFallbackCache();
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -371,8 +366,4 @@
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><del>-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SimpleFontData)
- static bool isType(const WebCore::FontData& fontData) { return !fontData.isSegmented(); }
-SPECIALIZE_TYPE_TRAITS_END()
-
</del><span class="cx"> #endif // SimpleFontData_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">
</span><span class="cx"> // By the time a WebCascadeList is used, the Font has already been asked to realize all of its
</span><span class="cx"> // FontData, so this loop does not hit the FontCache.
</span><del>- while (_font->fontDataAt(_count))
</del><ins>+ while (!_font->fallbackRangesAt(_count).isNull())
</ins><span class="cx"> _count++;
</span><span class="cx">
</span><span class="cx"> return self;
</span><span class="lines">@@ -82,9 +82,9 @@
</span><span class="cx"> } else
</span><span class="cx"> _fontDescriptors.grow(index + 1);
</span><span class="cx">
</span><del>- const WebCore::SimpleFontData* simpleFontData = _font->fontDataAt(index)->simpleFontDataForCharacter(_character);
</del><ins>+ const WebCore::SimpleFontData* simpleFontData = _font->fallbackRangesAt(index).fontDataForCharacter(_character);
</ins><span class="cx"> if (!simpleFontData)
</span><del>- simpleFontData = &_font->fontDataAt(index)->simpleFontDataForFirstRange();
</del><ins>+ simpleFontData = &_font->fallbackRangesAt(index).fontDataForFirstRange();
</ins><span class="cx"> fontDescriptor = CTFontCopyFontDescriptor(simpleFontData->platformData().ctFont());
</span><span class="cx"> _fontDescriptors[index] = adoptCF(fontDescriptor);
</span><span class="cx"> return (id)fontDescriptor;
</span><span class="lines">@@ -201,9 +201,9 @@
</span><span class="cx"> isSystemFallback = true;
</span><span class="cx">
</span><span class="cx"> U16_GET(cp, 0, 0, length, baseCharacter);
</span><del>- fontData = m_font.fontDataAt(0)->simpleFontDataForCharacter(baseCharacter);
</del><ins>+ fontData = m_font.fallbackRangesAt(0).fontDataForCharacter(baseCharacter);
</ins><span class="cx"> if (!fontData)
</span><del>- fontData = &m_font.fontDataAt(0)->simpleFontDataForFirstRange();
</del><ins>+ fontData = &m_font.fallbackRangesAt(0).fontDataForFirstRange();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<WebCascadeList> cascadeList = adoptNS([[WebCascadeList alloc] initWithFont:&m_font character:baseCharacter]);
</span><span class="cx">
</span><span class="lines">@@ -256,9 +256,9 @@
</span><span class="cx"> RetainPtr<CFTypeRef> runFontEqualityObject = FontPlatformData::objectForEqualityCheck(runFont);
</span><span class="cx"> if (!CFEqual(runFontEqualityObject.get(), fontData->platformData().objectForEqualityCheck().get())) {
</span><span class="cx"> // Begin trying to see if runFont matches any of the fonts in the fallback list.
</span><del>- unsigned i = 0;
- for (const FontData* candidateFontData = m_font.fontDataAt(i); candidateFontData; candidateFontData = m_font.fontDataAt(++i)) {
- runFontData = candidateFontData->simpleFontDataForCharacter(baseCharacter);
</del><ins>+
+ for (unsigned i = 0; !m_font.fallbackRangesAt(i).isNull(); ++i) {
+ runFontData = m_font.fallbackRangesAt(i).fontDataForCharacter(baseCharacter);
</ins><span class="cx"> if (!runFontData)
</span><span class="cx"> continue;
</span><span class="cx"> RetainPtr<CFTypeRef> runFontEqualityObject = runFontData->platformData().objectForEqualityCheck();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontComplexTextMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp (178387 => 178388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp        2015-01-13 23:56:25 UTC (rev 178387)
+++ trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp        2015-01-13 23:57:50 UTC (rev 178388)
</span><span class="lines">@@ -138,9 +138,8 @@
</span><span class="cx">
</span><span class="cx"> bool triedBaseCharacterFontData = false;
</span><span class="cx">
</span><del>- unsigned i = 0;
- for (const FontData* fontData = fontDataAt(0); fontData; fontData = fontDataAt(++i)) {
- const SimpleFontData* simpleFontData = fontData->simpleFontDataForCharacter(baseCharacter);
</del><ins>+ for (unsigned i = 0; !fallbackRangesAt(i).isEmpty(); ++i) {
+ const SimpleFontData* simpleFontData = fallbackRangesAt(i).fontDataForCharacter(baseCharacter);
</ins><span class="cx"> if (!simpleFontData)
</span><span class="cx"> continue;
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre>
</div>
</div>
</body>
</html>