<!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>[177229] 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/177229">177229</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2014-12-12 12:31:30 -0800 (Fri, 12 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>FontGlyphs::glyphDataAndPageForCharacter cleanups
https://bugs.webkit.org/show_bug.cgi?id=139584
Reviewed by Andreas Kling.
Split it up and use helper functions.
* WebCore.exp.in:
* platform/graphics/FontGlyphs.cpp:
(WebCore::FontGlyphs::determinePitch):
(WebCore::FontGlyphs::realizeFontDataAt):
(WebCore::FontGlyphs::glyphDataAndPageForSystemFallback):
(WebCore::FontGlyphs::glyphDataAndPageForVariant):
Add private helpers.
(WebCore::FontGlyphs::glyphDataAndPageForCharacter):
Do the m_pages cache lookup only once and use the pointer reference afterwards.
* platform/graphics/FontGlyphs.h:
(WebCore::FontGlyphs::fontSelector):
(WebCore::FontGlyphs::widthCache):
(WebCore::FontGlyphs::primaryFontData):
(WebCore::FontGlyphs::isFixedPitch):
(WebCore::FontGlyphs::primarySimpleFontData):
Also removed the mutable attribute from the fields (almost everything was marked mutable) and made the inteface
non-const. The FontGlyphs member of Font is already mutable so this is not needed.</pre>
<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCoreplatformgraphicsFontGlyphscpp">trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontGlyphsh">trunk/Source/WebCore/platform/graphics/FontGlyphs.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177228 => 177229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-12 20:28:17 UTC (rev 177228)
+++ trunk/Source/WebCore/ChangeLog        2014-12-12 20:31:30 UTC (rev 177229)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2014-12-12 Antti Koivisto <antti@apple.com>
+
+ FontGlyphs::glyphDataAndPageForCharacter cleanups
+ https://bugs.webkit.org/show_bug.cgi?id=139584
+
+ Reviewed by Andreas Kling.
+
+ Split it up and use helper functions.
+
+ * WebCore.exp.in:
+ * platform/graphics/FontGlyphs.cpp:
+ (WebCore::FontGlyphs::determinePitch):
+ (WebCore::FontGlyphs::realizeFontDataAt):
+ (WebCore::FontGlyphs::glyphDataAndPageForSystemFallback):
+ (WebCore::FontGlyphs::glyphDataAndPageForVariant):
+
+ Add private helpers.
+
+ (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
+
+ Do the m_pages cache lookup only once and use the pointer reference afterwards.
+
+ * platform/graphics/FontGlyphs.h:
+ (WebCore::FontGlyphs::fontSelector):
+ (WebCore::FontGlyphs::widthCache):
+ (WebCore::FontGlyphs::primaryFontData):
+ (WebCore::FontGlyphs::isFixedPitch):
+ (WebCore::FontGlyphs::primarySimpleFontData):
+
+ Also removed the mutable attribute from the fields (almost everything was marked mutable) and made the inteface
+ non-const. The FontGlyphs member of Font is already mutable so this is not needed.
+
</ins><span class="cx"> 2014-12-12 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Use is<>() / downcast<>() for StyleRuleBase subclasses
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (177228 => 177229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-12-12 20:28:17 UTC (rev 177228)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-12-12 20:31:30 UTC (rev 177229)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> __ZN7WebCore10FloatPointC1ERK7CGPoint
</span><span class="cx"> __ZN7WebCore10FloatPointC1ERKNS_8IntPointE
</span><span class="cx"> __ZN7WebCore10FontGlyphs15releaseFontDataEv
</span><ins>+__ZN7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj
</ins><span class="cx"> __ZN7WebCore10JSDocument6s_infoE
</span><span class="cx"> __ZN7WebCore10JSDocument9toWrappedEN3JSC7JSValueE
</span><span class="cx"> __ZN7WebCore10LayoutRect5scaleEf
</span><span class="lines">@@ -1583,7 +1584,6 @@
</span><span class="cx"> __ZNK7WebCore10Credential12nsCredentialEv
</span><span class="cx"> __ZNK7WebCore10Credential7isEmptyEv
</span><span class="cx"> __ZNK7WebCore10FloatPointcv7CGPointEv
</span><del>-__ZNK7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj
</del><span class="cx"> __ZNK7WebCore10LayoutRect8containsERKS0_
</span><span class="cx"> __ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringENS0_18AllowedPluginTypesE
</span><span class="cx"> __ZNK7WebCore10RenderText16firstRunLocationEv
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp (177228 => 177229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2014-12-12 20:28:17 UTC (rev 177228)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2014-12-12 20:31:30 UTC (rev 177229)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void FontGlyphs::determinePitch(const FontDescription& description) const
</del><ins>+void FontGlyphs::determinePitch(const FontDescription& description)
</ins><span class="cx"> {
</span><span class="cx"> const FontData* fontData = primaryFontData(description);
</span><span class="cx"> if (is<SimpleFontData>(*fontData))
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const FontData* FontGlyphs::realizeFontDataAt(const FontDescription& description, unsigned realizedFontIndex) const
</del><ins>+const FontData* FontGlyphs::realizeFontDataAt(const FontDescription& description, unsigned realizedFontIndex)
</ins><span class="cx"> {
</span><span class="cx"> if (realizedFontIndex < m_realizedFontData.size())
</span><span class="cx"> return m_realizedFontData[realizedFontIndex].get(); // This fallback font is already in our list.
</span><span class="lines">@@ -256,115 +256,10 @@
</span><span class="cx"> return std::make_pair(data, page);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForCharacter(const FontDescription& description, UChar32 c, bool mirror, FontDataVariant variant) const
</del><ins>+std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForSystemFallback(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode& node)
</ins><span class="cx"> {
</span><del>- ASSERT(isMainThread());
-
- if (variant == AutoVariant) {
- if (description.smallCaps() && !primarySimpleFontData(description)->isSVGFont()) {
- UChar32 upperC = u_toupper(c);
- if (upperC != c) {
- c = upperC;
- variant = SmallCapsVariant;
- } else
- variant = NormalVariant;
- } else
- variant = NormalVariant;
- }
-
- if (mirror)
- c = u_charMirror(c);
-
- unsigned pageNumber = (c / GlyphPage::size);
-
- GlyphPageTreeNode* node = pageNumber ? m_pages.get(pageNumber) : m_pageZero;
- if (!node) {
- node = GlyphPageTreeNode::getRootChild(realizeFontDataAt(description, 0), pageNumber);
- if (pageNumber)
- m_pages.set(pageNumber, node);
- else
- m_pageZero = node;
- }
-
- GlyphPage* page = 0;
- if (variant == NormalVariant) {
- // Fastest loop, for the common case (normal variant).
- while (true) {
- page = node->page();
- if (page) {
- GlyphData data = page->glyphDataForCharacter(c);
- if (data.fontData && (data.fontData->platformData().orientation() == Horizontal || data.fontData->isTextOrientationFallback()))
- return std::make_pair(data, page);
-
- if (data.fontData) {
- if (Font::isCJKIdeographOrSymbol(c)) {
- if (!data.fontData->hasVerticalGlyphs()) {
- // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
- // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
- variant = BrokenIdeographVariant;
- break;
- }
-#if PLATFORM(COCOA)
- else if (data.fontData->platformData().syntheticOblique())
- return glyphDataAndPageForCJKCharacterWithoutSyntheticItalic(c, data, page, pageNumber);
-#endif
- } else
- return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, page, pageNumber);
-
- return std::make_pair(data, page);
- }
-
- if (node->isSystemFallback())
- break;
- }
-
- node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
- if (pageNumber)
- m_pages.set(pageNumber, node);
- else
- m_pageZero = node;
- }
- }
- if (variant != NormalVariant) {
- while (true) {
- page = node->page();
- if (page) {
- GlyphData data = page->glyphDataForCharacter(c);
- if (data.fontData) {
- // The variantFontData function should not normally return 0.
- // But if it does, we will just render the capital letter big.
- RefPtr<SimpleFontData> variantFontData = data.fontData->variantFontData(description, variant);
- if (!variantFontData)
- return std::make_pair(data, page);
-
- GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
- GlyphPage* variantPage = variantNode->page();
- if (variantPage) {
- GlyphData data = variantPage->glyphDataForCharacter(c);
- if (data.fontData)
- return std::make_pair(data, variantPage);
- }
-
- // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
- // a font has the lowercase character but the small caps font does not have its uppercase version.
- return std::make_pair(variantFontData->missingGlyphData(), page);
- }
-
- if (node->isSystemFallback())
- break;
- }
-
- node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
- if (pageNumber)
- m_pages.set(pageNumber, node);
- else
- m_pageZero = node;
- }
- }
-
- ASSERT(page);
- ASSERT(node->isSystemFallback());
-
</del><ins>+ ASSERT(node.page());
+ ASSERT(node.isSystemFallback());
</ins><span class="cx"> // System fallback is character-dependent. When we get here, we
</span><span class="cx"> // know that the character in question isn't in the system fallback
</span><span class="cx"> // font's glyph page. Try to lazily create it here.
</span><span class="lines">@@ -392,23 +287,113 @@
</span><span class="cx"> GlyphData data = fallbackPage && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
</span><span class="cx"> // Cache it so we don't have to do system fallback again next time.
</span><span class="cx"> if (variant == NormalVariant) {
</span><del>- page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
- data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
</del><ins>+ node.page()->setGlyphDataForCharacter(c, data.glyph, data.fontData);
+ data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node.level()));
</ins><span class="cx"> if (!Font::isCJKIdeographOrSymbol(c) && data.fontData->platformData().orientation() != Horizontal && !data.fontData->isTextOrientationFallback())
</span><span class="cx"> return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, fallbackPage, pageNumber);
</span><span class="cx"> }
</span><del>- return std::make_pair(data, page);
</del><ins>+ return std::make_pair(data, node.page());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Even system fallback can fail; use the missing glyph in that case.
</span><span class="cx"> // FIXME: It would be nicer to use the missing glyph from the last resort font instead.
</span><span class="cx"> GlyphData data = primarySimpleFontData(description)->missingGlyphData();
</span><span class="cx"> if (variant == NormalVariant) {
</span><del>- page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
- data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
</del><ins>+ node.page()->setGlyphDataForCharacter(c, data.glyph, data.fontData);
+ data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node.level()));
</ins><span class="cx"> }
</span><del>- return std::make_pair(data, page);
</del><ins>+ return std::make_pair(data, node.page());
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForVariant(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode*& node)
+{
+ while (true) {
+ if (GlyphPage* page = node->page()) {
+ GlyphData data = page->glyphDataForCharacter(c);
+ if (data.fontData) {
+ // The variantFontData function should not normally return 0.
+ // But if it does, we will just render the capital letter big.
+ RefPtr<SimpleFontData> variantFontData = data.fontData->variantFontData(description, variant);
+ if (!variantFontData)
+ return std::make_pair(data, page);
</ins><span class="cx">
</span><ins>+ GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
+ GlyphPage* variantPage = variantNode->page();
+ if (variantPage) {
+ GlyphData data = variantPage->glyphDataForCharacter(c);
+ if (data.fontData)
+ return std::make_pair(data, variantPage);
+ }
+
+ // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
+ // a font has the lowercase character but the small caps font does not have its uppercase version.
+ return std::make_pair(variantFontData->missingGlyphData(), page);
+ }
+
+ if (node->isSystemFallback())
+ return glyphDataAndPageForSystemFallback(c, description, variant, pageNumber, *node);
+ }
+
+ node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
+ }
</ins><span class="cx"> }
</span><ins>+
+std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForCharacter(const FontDescription& description, UChar32 c, bool mirror, FontDataVariant variant)
+{
+ ASSERT(isMainThread());
+
+ if (variant == AutoVariant) {
+ if (description.smallCaps() && !primarySimpleFontData(description)->isSVGFont()) {
+ UChar32 upperC = u_toupper(c);
+ if (upperC != c) {
+ c = upperC;
+ variant = SmallCapsVariant;
+ } else
+ variant = NormalVariant;
+ } else
+ variant = NormalVariant;
+ }
+
+ if (mirror)
+ c = u_charMirror(c);
+
+ const unsigned pageNumber = (c / GlyphPage::size);
+
+ GlyphPageTreeNode*& node = pageNumber ? m_pages.add(pageNumber, nullptr).iterator->value : m_pageZero;
+ if (!node)
+ node = GlyphPageTreeNode::getRootChild(realizeFontDataAt(description, 0), pageNumber);
+
+ if (variant != NormalVariant)
+ return glyphDataAndPageForVariant(c, description, variant, pageNumber, node);
+
+ while (true) {
+ if (GlyphPage* page = node->page()) {
+ GlyphData data = page->glyphDataForCharacter(c);
+ if (data.fontData) {
+ if (data.fontData->platformData().orientation() == Vertical && !data.fontData->isTextOrientationFallback()) {
+ if (!Font::isCJKIdeographOrSymbol(c))
+ return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, page, pageNumber);
+
+ if (!data.fontData->hasVerticalGlyphs()) {
+ // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
+ // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
+ return glyphDataAndPageForVariant(c, description, BrokenIdeographVariant, pageNumber, node);
+ }
+#if PLATFORM(COCOA)
+ if (data.fontData->platformData().syntheticOblique())
+ return glyphDataAndPageForCJKCharacterWithoutSyntheticItalic(c, data, page, pageNumber);
+#endif
+ }
+
+ return std::make_pair(data, page);
+ }
+
+ if (node->isSystemFallback())
+ return glyphDataAndPageForSystemFallback(c, description, variant, pageNumber, *node);
+ }
+
+ node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
+ }
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.h (177228 => 177229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2014-12-12 20:28:17 UTC (rev 177228)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2014-12-12 20:31:30 UTC (rev 177229)
</span><span class="lines">@@ -75,52 +75,56 @@
</span><span class="cx">
</span><span class="cx"> bool isForPlatformFont() const { return m_isForPlatformFont; }
</span><span class="cx">
</span><del>- std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(const FontDescription&, UChar32, bool mirror, FontDataVariant) const;
-
- bool isFixedPitch(const FontDescription&) const;
- void determinePitch(const FontDescription&) const;
</del><ins>+ std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(const FontDescription&, UChar32, bool mirror, FontDataVariant);
</ins><span class="cx">
</span><ins>+ bool isFixedPitch(const FontDescription&);
+ void determinePitch(const FontDescription&);
+
</ins><span class="cx"> bool loadingCustomFonts() const { return m_loadingCustomFonts; }
</span><span class="cx">
</span><del>- FontSelector* fontSelector() const { return m_fontSelector.get(); }
</del><ins>+ FontSelector* fontSelector() { return m_fontSelector.get(); }
</ins><span class="cx"> // FIXME: It should be possible to combine fontSelectorVersion and generation.
</span><span class="cx"> unsigned fontSelectorVersion() const { return m_fontSelectorVersion; }
</span><span class="cx"> unsigned generation() const { return m_generation; }
</span><span class="cx">
</span><del>- WidthCache& widthCache() const { return m_widthCache; }
</del><ins>+ WidthCache& widthCache() { return m_widthCache; }
+ const WidthCache& widthCache() const { return m_widthCache; }
</ins><span class="cx">
</span><del>- const SimpleFontData* primarySimpleFontData(const FontDescription&) const;
- const FontData* primaryFontData(const FontDescription& description) const { return realizeFontDataAt(description, 0); }
- WEBCORE_EXPORT const FontData* realizeFontDataAt(const FontDescription&, unsigned index) const;
</del><ins>+ const SimpleFontData* primarySimpleFontData(const FontDescription&);
+ const FontData* primaryFontData(const FontDescription& description) { return realizeFontDataAt(description, 0); }
+ WEBCORE_EXPORT const FontData* realizeFontDataAt(const FontDescription&, unsigned index);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> FontGlyphs(PassRefPtr<FontSelector>);
</span><span class="cx"> FontGlyphs(const FontPlatformData&);
</span><span class="cx">
</span><ins>+ std::pair<GlyphData, GlyphPage*> glyphDataAndPageForSystemFallback(UChar32, const FontDescription&, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode&);
+ std::pair<GlyphData, GlyphPage*> glyphDataAndPageForVariant(UChar32, const FontDescription&, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode*&);
+
</ins><span class="cx"> WEBCORE_EXPORT void releaseFontData();
</span><span class="cx">
</span><del>- mutable Vector<RefPtr<FontData>, 1> m_realizedFontData;
- mutable GlyphPages m_pages;
- mutable GlyphPageTreeNode* m_pageZero;
- mutable const SimpleFontData* m_cachedPrimarySimpleFontData;
</del><ins>+ Vector<RefPtr<FontData>, 1> m_realizedFontData;
+ GlyphPages m_pages;
+ GlyphPageTreeNode* m_pageZero;
+ const SimpleFontData* m_cachedPrimarySimpleFontData;
</ins><span class="cx"> RefPtr<FontSelector> m_fontSelector;
</span><del>- mutable WidthCache m_widthCache;
</del><ins>+ WidthCache m_widthCache;
</ins><span class="cx"> unsigned m_fontSelectorVersion;
</span><del>- mutable int m_familyIndex;
</del><ins>+ int m_familyIndex;
</ins><span class="cx"> unsigned short m_generation;
</span><del>- mutable unsigned m_pitch : 3; // Pitch
- mutable bool m_loadingCustomFonts : 1;
- bool m_isForPlatformFont : 1;
</del><ins>+ unsigned m_pitch : 3; // Pitch
+ unsigned m_loadingCustomFonts : 1;
+ unsigned m_isForPlatformFont : 1;
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool FontGlyphs::isFixedPitch(const FontDescription& description) const
</del><ins>+inline bool FontGlyphs::isFixedPitch(const FontDescription& description)
</ins><span class="cx"> {
</span><span class="cx"> if (m_pitch == UnknownPitch)
</span><span class="cx"> determinePitch(description);
</span><span class="cx"> return m_pitch == FixedPitch;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline const SimpleFontData* FontGlyphs::primarySimpleFontData(const FontDescription& description) const
</del><ins>+inline const SimpleFontData* FontGlyphs::primarySimpleFontData(const FontDescription& description)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> if (!m_cachedPrimarySimpleFontData)
</span></span></pre>
</div>
</div>
</body>
</html>