<!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>[189539] 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/189539">189539</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-09-09 05:26:08 -0700 (Wed, 09 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Split mixed font GlyphPage functionality to separate class
https://bugs.webkit.org/show_bug.cgi?id=148965

Reviewed by Myles Maxfield.

Currently GlyphPage class is used for both immutable single font case (in Font) and
for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
classed for these cases. This will also make future improvements easier.

* platform/graphics/Font.cpp:
(WebCore::Font::~Font):
(WebCore::fillGlyphPage):
(WebCore::createAndFillGlyphPage):
(WebCore::Font::glyphPage):
(WebCore::Font::glyphForCharacter):
(WebCore::Font::glyphDataForCharacter):
* platform/graphics/Font.h:
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
(WebCore::MixedFontGlyphPage::glyphDataForCharacter):
(WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
(WebCore::MixedFontGlyphPage::setGlyphDataForIndex):

    Mixed font pages are now an implementation detail of FontCascadeFonts.

(WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
(WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
(WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):

    Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.

(WebCore::FontCascadeFonts::FontCascadeFonts):
(WebCore::FontCascadeFonts::glyphDataForCharacter):
(WebCore::FontCascadeFonts::pruneSystemFallbacks):
* platform/graphics/FontCascadeFonts.h:
(WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
(WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
* platform/graphics/GlyphPage.h:

    GlyphPage is now for single font mappings only.
    Use regular allocation instead of variable size tricks.
    It is always immutable after initialization (though currently a setter is still needed).

(WebCore::GlyphPage::create):
(WebCore::GlyphPage::~GlyphPage):
(WebCore::GlyphPage::count):
(WebCore::GlyphPage::indexForCharacter):
(WebCore::GlyphPage::glyphDataForCharacter):
(WebCore::GlyphPage::glyphForCharacter):
(WebCore::GlyphPage::glyphDataForIndex):
(WebCore::GlyphPage::glyphForIndex):
(WebCore::GlyphPage::setGlyphForIndex):
(WebCore::GlyphPage::font):
(WebCore::GlyphPage::GlyphPage):
(WebCore::GlyphPage::createForMixedFonts): Deleted.
(WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
(WebCore::GlyphPage::createForSingleFont): Deleted.
(WebCore::GlyphPage::isImmutable): Deleted.
(WebCore::GlyphPage::setImmutable): Deleted.
(WebCore::GlyphPage::glyphAt): Deleted.
(WebCore::GlyphPage::fontForCharacter): Deleted.
(WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
(WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
(WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/mac/GlyphPageMac.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/opentype/OpenTypeVerticalData.cpp:
(WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
(WebCore::GlyphPage::fill):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):
(WebCore::SVGFontData::fillSVGGlyphPage):
(WebCore::SVGFontData::fillBMPGlyphs):
(WebCore::SVGFontData::fillNonBMPGlyphs):
* svg/SVGFontData.h:
(WebCore::SVGFontData::verticalAdvanceY):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontcpp">trunk/Source/WebCore/platform/graphics/Font.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFonth">trunk/Source/WebCore/platform/graphics/Font.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadeFontscpp">trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadeFontsh">trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGlyphPageh">trunk/Source/WebCore/platform/graphics/GlyphPage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeGlyphPageTreeNodeFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGlyphPageMaccpp">trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopentypeOpenTypeVerticalDatacpp">trunk/Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCGWincpp">trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCairoWincpp">trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontDatacpp">trunk/Source/WebCore/svg/SVGFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontDatah">trunk/Source/WebCore/svg/SVGFontData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/ChangeLog        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -1,3 +1,87 @@
</span><ins>+2015-09-09  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Split mixed font GlyphPage functionality to separate class
+        https://bugs.webkit.org/show_bug.cgi?id=148965
+
+        Reviewed by Myles Maxfield.
+
+        Currently GlyphPage class is used for both immutable single font case (in Font) and
+        for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
+        classed for these cases. This will also make future improvements easier.
+
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::~Font):
+        (WebCore::fillGlyphPage):
+        (WebCore::createAndFillGlyphPage):
+        (WebCore::Font::glyphPage):
+        (WebCore::Font::glyphForCharacter):
+        (WebCore::Font::glyphDataForCharacter):
+        * platform/graphics/Font.h:
+        * platform/graphics/FontCascadeFonts.cpp:
+        (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
+        (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
+        (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
+        (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
+
+            Mixed font pages are now an implementation detail of FontCascadeFonts.
+
+        (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
+        (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
+        (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
+
+            Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
+
+        (WebCore::FontCascadeFonts::FontCascadeFonts):
+        (WebCore::FontCascadeFonts::glyphDataForCharacter):
+        (WebCore::FontCascadeFonts::pruneSystemFallbacks):
+        * platform/graphics/FontCascadeFonts.h:
+        (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
+        (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
+        * platform/graphics/GlyphPage.h:
+
+            GlyphPage is now for single font mappings only.
+            Use regular allocation instead of variable size tricks.
+            It is always immutable after initialization (though currently a setter is still needed).
+
+        (WebCore::GlyphPage::create):
+        (WebCore::GlyphPage::~GlyphPage):
+        (WebCore::GlyphPage::count):
+        (WebCore::GlyphPage::indexForCharacter):
+        (WebCore::GlyphPage::glyphDataForCharacter):
+        (WebCore::GlyphPage::glyphForCharacter):
+        (WebCore::GlyphPage::glyphDataForIndex):
+        (WebCore::GlyphPage::glyphForIndex):
+        (WebCore::GlyphPage::setGlyphForIndex):
+        (WebCore::GlyphPage::font):
+        (WebCore::GlyphPage::GlyphPage):
+        (WebCore::GlyphPage::createForMixedFonts): Deleted.
+        (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
+        (WebCore::GlyphPage::createForSingleFont): Deleted.
+        (WebCore::GlyphPage::isImmutable): Deleted.
+        (WebCore::GlyphPage::setImmutable): Deleted.
+        (WebCore::GlyphPage::glyphAt): Deleted.
+        (WebCore::GlyphPage::fontForCharacter): Deleted.
+        (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
+        (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
+        (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
+        * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
+        (WebCore::GlyphPage::fill):
+        * platform/graphics/mac/GlyphPageMac.cpp:
+        (WebCore::GlyphPage::fill):
+        * platform/graphics/opentype/OpenTypeVerticalData.cpp:
+        (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
+        * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
+        (WebCore::GlyphPage::fill):
+        * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
+        (WebCore::GlyphPage::fill):
+        * svg/SVGFontData.cpp:
+        (WebCore::SVGFontData::applySVGGlyphSelection):
+        (WebCore::SVGFontData::fillSVGGlyphPage):
+        (WebCore::SVGFontData::fillBMPGlyphs):
+        (WebCore::SVGFontData::fillNonBMPGlyphs):
+        * svg/SVGFontData.h:
+        (WebCore::SVGFontData::verticalAdvanceY):
+
</ins><span class="cx"> 2015-09-09  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Percentage columns shouldn't include border and padding
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -149,27 +149,27 @@
</span><span class="cx">     removeFromSystemFallbackCache();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool fillGlyphPage(GlyphPage&amp; pageToFill, UChar* buffer, unsigned bufferLength, const Font* font)
</del><ins>+static bool fillGlyphPage(GlyphPage&amp; pageToFill, UChar* buffer, unsigned bufferLength, const Font&amp; font)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>-    if (auto* svgData = font-&gt;svgData())
-        return svgData-&gt;fillSVGGlyphPage(&amp;pageToFill, buffer, bufferLength, font);
</del><ins>+    if (auto* svgData = font.svgData())
+        return svgData-&gt;fillSVGGlyphPage(&amp;pageToFill, buffer, bufferLength);
</ins><span class="cx"> #endif
</span><del>-    bool hasGlyphs = pageToFill.fill(buffer, bufferLength, font);
</del><ins>+    bool hasGlyphs = pageToFill.fill(buffer, bufferLength, &amp;font);
</ins><span class="cx"> #if ENABLE(OPENTYPE_VERTICAL)
</span><del>-    if (hasGlyphs &amp;&amp; font-&gt;verticalData())
-        font-&gt;verticalData()-&gt;substituteWithVerticalGlyphs(font, &amp;pageToFill);
</del><ins>+    if (hasGlyphs &amp;&amp; font.verticalData())
+        font.verticalData()-&gt;substituteWithVerticalGlyphs(&amp;font, &amp;pageToFill);
</ins><span class="cx"> #endif
</span><span class="cx">     return hasGlyphs;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;GlyphPage&gt; createAndFillGlyphPage(unsigned pageNumber, const Font* font)
</del><ins>+static RefPtr&lt;GlyphPage&gt; createAndFillGlyphPage(unsigned pageNumber, const Font&amp; font)
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // FIXME: Times New Roman contains Arabic glyphs, but Core Text doesn't know how to shape them. See &lt;rdar://problem/9823975&gt;.
</span><span class="cx">     // Once we have the fix for &lt;rdar://problem/9823975&gt; then remove this code together with Font::shouldNotBeUsedForArabic()
</span><span class="cx">     // in &lt;rdar://problem/12096835&gt;.
</span><del>-    if (pageNumber == 6 &amp;&amp; font-&gt;shouldNotBeUsedForArabic())
</del><ins>+    if (pageNumber == 6 &amp;&amp; font.shouldNotBeUsedForArabic())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -226,26 +226,25 @@
</span><span class="cx">     // routine of our glyph map for actually filling in the page with the glyphs.
</span><span class="cx">     // Success is not guaranteed. For example, Times fails to fill page 260, giving glyph data
</span><span class="cx">     // for only 128 out of 256 characters.
</span><del>-    RefPtr&lt;GlyphPage&gt; glyphPage = GlyphPage::createForSingleFont(font);
</del><ins>+    Ref&lt;GlyphPage&gt; glyphPage = GlyphPage::create(font);
</ins><span class="cx"> 
</span><del>-    bool haveGlyphs = fillGlyphPage(*glyphPage, buffer, bufferLength, font);
</del><ins>+    bool haveGlyphs = fillGlyphPage(glyphPage, buffer, bufferLength, font);
</ins><span class="cx">     if (!haveGlyphs)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    glyphPage-&gt;setImmutable();
-    return glyphPage;
</del><ins>+    return WTF::move(glyphPage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const GlyphPage* Font::glyphPage(unsigned pageNumber) const
</span><span class="cx"> {
</span><span class="cx">     if (!pageNumber) {
</span><span class="cx">         if (!m_glyphPageZero)
</span><del>-            m_glyphPageZero = createAndFillGlyphPage(0, this);
</del><ins>+            m_glyphPageZero = createAndFillGlyphPage(0, *this);
</ins><span class="cx">         return m_glyphPageZero.get();
</span><span class="cx">     }
</span><span class="cx">     auto addResult = m_glyphPages.add(pageNumber, nullptr);
</span><span class="cx">     if (addResult.isNewEntry)
</span><del>-        addResult.iterator-&gt;value = createAndFillGlyphPage(pageNumber, this);
</del><ins>+        addResult.iterator-&gt;value = createAndFillGlyphPage(pageNumber, *this);
</ins><span class="cx"> 
</span><span class="cx">     return addResult.iterator-&gt;value.get();
</span><span class="cx"> }
</span><span class="lines">@@ -255,7 +254,7 @@
</span><span class="cx">     auto* page = glyphPage(character / GlyphPage::size);
</span><span class="cx">     if (!page)
</span><span class="cx">         return 0;
</span><del>-    return page-&gt;glyphAt(character % GlyphPage::size);
</del><ins>+    return page-&gt;glyphForCharacter(character);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GlyphData Font::glyphDataForCharacter(UChar32 character) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.h (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.h        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/Font.h        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">         virtual void initializeFont(Font*, float fontSize) = 0;
</span><span class="cx">         virtual float widthForSVGGlyph(Glyph, float fontSize) const = 0;
</span><del>-        virtual bool fillSVGGlyphPage(GlyphPage*, UChar* buffer, unsigned bufferLength, const Font*) const = 0;
</del><ins>+        virtual bool fillSVGGlyphPage(GlyphPage*, UChar* buffer, unsigned bufferLength) const = 0;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Used to create platform fonts.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadeFontscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -35,7 +35,67 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class MixedFontGlyphPage {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    MixedFontGlyphPage(const GlyphPage* initialPage)
+    {
+        if (initialPage) {
+            for (unsigned i = 0; i &lt; GlyphPage::size; ++i)
+                setGlyphDataForIndex(i, initialPage-&gt;glyphDataForIndex(i));
+        }
+    }
</ins><span class="cx"> 
</span><ins>+    GlyphData glyphDataForCharacter(UChar32 c) const
+    {
+        unsigned index = GlyphPage::indexForCharacter(c);
+        ASSERT_WITH_SECURITY_IMPLICATION(index &lt; GlyphPage::size);
+        return { m_glyphs[index], m_fonts[index] };
+    }
+
+    void setGlyphDataForCharacter(UChar32 c, GlyphData glyphData)
+    {
+        setGlyphDataForIndex(GlyphPage::indexForCharacter(c), glyphData);
+    }
+
+private:
+    void setGlyphDataForIndex(unsigned index, const GlyphData&amp; glyphData)
+    {
+        ASSERT_WITH_SECURITY_IMPLICATION(index &lt; GlyphPage::size);
+        m_glyphs[index] = glyphData.glyph;
+        m_fonts[index] = glyphData.font;
+    }
+
+    Glyph m_glyphs[GlyphPage::size] { };
+    const Font* m_fonts[GlyphPage::size] { };
+};
+
+GlyphData FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter(UChar32 character)
+{
+    ASSERT(!(m_singleFont &amp;&amp; m_mixedFont));
+    if (m_singleFont)
+        return m_singleFont-&gt;glyphDataForCharacter(character);
+    if (m_mixedFont)
+        return m_mixedFont-&gt;glyphDataForCharacter(character);
+    return 0;
+}
+
+void FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter(UChar32 character, GlyphData glyphData)
+{
+    ASSERT(!glyphDataForCharacter(character).glyph);
+    if (!m_mixedFont) {
+        m_mixedFont = std::make_unique&lt;MixedFontGlyphPage&gt;(m_singleFont.get());
+        m_singleFont = nullptr;
+    }
+    m_mixedFont-&gt;setGlyphDataForCharacter(character, glyphData);
+}
+
+void FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage(RefPtr&lt;GlyphPage&gt;&amp;&amp; page)
+{
+    ASSERT(isNull());
+    m_singleFont = page;
+}
+
</ins><span class="cx"> FontCascadeFonts::FontCascadeFonts(RefPtr&lt;FontSelector&gt;&amp;&amp; fontSelector)
</span><span class="cx">     : m_cachedPrimaryFont(nullptr)
</span><span class="cx">     , m_fontSelector(fontSelector)
</span><span class="lines">@@ -371,20 +431,20 @@
</span><span class="cx"> 
</span><span class="cx">     const unsigned pageNumber = c / GlyphPage::size;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;GlyphPage&gt;&amp; cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator-&gt;value : m_cachedPageZero;
-    if (!cachedPage)
-        cachedPage = glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0));
</del><ins>+    auto&amp; cacheEntry = pageNumber ? m_cachedPages.add(pageNumber, GlyphPageCacheEntry()).iterator-&gt;value : m_cachedPageZero;
</ins><span class="cx"> 
</span><del>-    GlyphData glyphData = cachedPage ? cachedPage-&gt;glyphDataForCharacter(c) : GlyphData();
</del><ins>+    // Initialize cache with a full page of glyph mappings from a single font.
+    if (cacheEntry.isNull())
+        cacheEntry.setSingleFontPage(glyphPageFromFontRanges(pageNumber, realizeFallbackRangesAt(description, 0)));
+
+    GlyphData glyphData = cacheEntry.glyphDataForCharacter(c);
</ins><span class="cx">     if (!glyphData.glyph) {
</span><del>-        if (!cachedPage)
-            cachedPage = GlyphPage::createForMixedFonts();
-        else if (cachedPage-&gt;isImmutable())
-            cachedPage = GlyphPage::createCopyForMixedFonts(*cachedPage);
-
</del><ins>+        // No glyph, resolve per-character.
</ins><span class="cx">         glyphData = glyphDataForNormalVariant(c, description);
</span><del>-        cachedPage-&gt;setGlyphDataForCharacter(c, glyphData.glyph, glyphData.font);
</del><ins>+        // Cache the results.
+        cacheEntry.setGlyphDataForCharacter(c, glyphData);
</ins><span class="cx">     }
</span><ins>+
</ins><span class="cx">     return glyphData;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -393,10 +453,10 @@
</span><span class="cx">     if (m_systemFallbackFontSet.isEmpty())
</span><span class="cx">         return;
</span><span class="cx">     // Mutable glyph pages may reference fallback fonts.
</span><del>-    if (m_cachedPageZero &amp;&amp; !m_cachedPageZero-&gt;isImmutable())
-        m_cachedPageZero = nullptr;
</del><ins>+    if (m_cachedPageZero.isMixedFont())
+        m_cachedPageZero = { };
</ins><span class="cx">     m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType&amp; keyAndValue) {
</span><del>-        return !keyAndValue.value-&gt;isImmutable();
</del><ins>+        return keyAndValue.value.isMixedFont();
</ins><span class="cx">     });
</span><span class="cx">     m_systemFallbackFontSet.clear();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadeFontsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -35,11 +35,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class GraphicsContext;
-class IntRect;
</del><span class="cx"> class FontDescription;
</span><span class="cx"> class FontPlatformData;
</span><span class="cx"> class FontSelector;
</span><ins>+class GraphicsContext;
+class IntRect;
+class MixedFontGlyphPage;
</ins><span class="cx"> 
</span><span class="cx"> class FontCascadeFonts : public RefCounted&lt;FontCascadeFonts&gt; {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(FontCascadeFonts);
</span><span class="lines">@@ -82,9 +83,25 @@
</span><span class="cx">     Vector&lt;FontRanges, 1&gt; m_realizedFallbackRanges;
</span><span class="cx">     unsigned m_lastRealizedFallbackIndex { 0 };
</span><span class="cx"> 
</span><del>-    RefPtr&lt;GlyphPage&gt; m_cachedPageZero;
-    HashMap&lt;int, RefPtr&lt;GlyphPage&gt;&gt; m_cachedPages;
</del><ins>+    class GlyphPageCacheEntry {
+    public:
+        GlyphData glyphDataForCharacter(UChar32);
</ins><span class="cx"> 
</span><ins>+        void setSingleFontPage(RefPtr&lt;GlyphPage&gt;&amp;&amp;);
+        void setGlyphDataForCharacter(UChar32, GlyphData);
+
+        bool isNull() const { return !m_singleFont &amp;&amp; !m_mixedFont; }
+        bool isMixedFont() const { return !!m_mixedFont; }
+    
+    private:
+        // Only one of these is non-null.
+        RefPtr&lt;GlyphPage&gt; m_singleFont;
+        std::unique_ptr&lt;MixedFontGlyphPage&gt; m_mixedFont;
+    };
+
+    GlyphPageCacheEntry m_cachedPageZero;
+    HashMap&lt;int, GlyphPageCacheEntry&gt; m_cachedPages;
+
</ins><span class="cx">     HashSet&lt;RefPtr&lt;Font&gt;&gt; m_systemFallbackFontSet;
</span><span class="cx"> 
</span><span class="cx">     const Font* m_cachedPrimaryFont;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGlyphPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GlyphPage.h (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GlyphPage.h        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/GlyphPage.h        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -53,137 +53,76 @@
</span><span class="cx">     const Font* font;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if COMPILER(MSVC)
-#pragma warning(push)
-#pragma warning(disable: 4200) // Disable &quot;zero-sized array in struct/union&quot; warning
-#endif
-
</del><span class="cx"> // A GlyphPage contains a fixed-size set of GlyphData mappings for a contiguous
</span><span class="cx"> // range of characters in the Unicode code space. GlyphPages are indexed
</span><span class="cx"> // starting from 0 and incrementing for each 256 glyphs.
</span><del>-//
-// One page may actually include glyphs from other fonts if the characters are
-// missing in the primary font.
</del><span class="cx"> class GlyphPage : public RefCounted&lt;GlyphPage&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;GlyphPage&gt; createForMixedFonts()
</del><ins>+    static Ref&lt;GlyphPage&gt; create(const Font&amp; font)
</ins><span class="cx">     {
</span><del>-        void* slot = fastMalloc(sizeof(GlyphPage) + sizeof(Font*) * GlyphPage::size);
-        return adoptRef(new (NotNull, slot) GlyphPage(nullptr));
</del><ins>+        return adoptRef(*new GlyphPage(font));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static PassRefPtr&lt;GlyphPage&gt; createCopyForMixedFonts(const GlyphPage&amp; original)
-    {
-        RefPtr&lt;GlyphPage&gt; page = createForMixedFonts();
-        for (unsigned i = 0; i &lt; GlyphPage::size; ++i)
-            page-&gt;setGlyphDataForIndex(i, original.glyphDataForIndex(i));
-        return page.release();
-    }
-
-    static PassRefPtr&lt;GlyphPage&gt; createForSingleFont(const Font* font)
-    {
-        ASSERT(font);
-        return adoptRef(new GlyphPage(font));
-    }
-
</del><span class="cx">     ~GlyphPage()
</span><span class="cx">     {
</span><span class="cx">         --s_count;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool isImmutable() const { return m_isImmutable; }
-    void setImmutable() { m_isImmutable = true; }
-
</del><span class="cx">     static unsigned count() { return s_count; }
</span><span class="cx"> 
</span><span class="cx">     static const size_t size = 256; // Covers Latin-1 in a single page.
</span><del>-    static_assert((!(0xD800 % size)) &amp;&amp; (!(0xDC00 % size)) &amp;&amp; (!(0xE000 % size)), &quot;GlyphPages must never straddle code-unit length boundaries&quot;);
</del><span class="cx">     static unsigned indexForCharacter(UChar32 c) { return c % GlyphPage::size; }
</span><span class="cx"> 
</span><del>-    ALWAYS_INLINE GlyphData glyphDataForCharacter(UChar32 c) const
</del><ins>+    GlyphData glyphDataForCharacter(UChar32 c) const
</ins><span class="cx">     {
</span><span class="cx">         return glyphDataForIndex(indexForCharacter(c));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ALWAYS_INLINE GlyphData glyphDataForIndex(unsigned index) const
</del><ins>+    Glyph glyphForCharacter(UChar32 c) const
</ins><span class="cx">     {
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(index &lt; size);
-        Glyph glyph = m_glyphs[index];
-        if (hasPerGlyphFontData())
-            return GlyphData(glyph, m_perGlyphFontData[index]);
-        return GlyphData(glyph, glyph ? m_fontForAllGlyphs : 0);
</del><ins>+        return glyphForIndex(indexForCharacter(c));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ALWAYS_INLINE Glyph glyphAt(unsigned index) const
</del><ins>+    GlyphData glyphDataForIndex(unsigned index) const
</ins><span class="cx">     {
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(index &lt; size);
-        return m_glyphs[index];
</del><ins>+        Glyph glyph = glyphForIndex(index);
+        return GlyphData(glyph, glyph ? &amp;m_font : nullptr);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ALWAYS_INLINE const Font* fontForCharacter(UChar32 c) const
</del><ins>+    Glyph glyphForIndex(unsigned index) const
</ins><span class="cx">     {
</span><del>-        unsigned index = indexForCharacter(c);
-        if (hasPerGlyphFontData())
-            return m_perGlyphFontData[index];
-        return m_glyphs[index] ? m_fontForAllGlyphs : 0;
</del><ins>+        ASSERT_WITH_SECURITY_IMPLICATION(index &lt; size);
+        return m_glyphs[index];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void setGlyphDataForCharacter(UChar32 c, Glyph g, const Font* f)
</del><ins>+    // FIXME: Pages are immutable after initialization. This should be private.
+    void setGlyphForIndex(unsigned index, Glyph glyph)
</ins><span class="cx">     {
</span><del>-        setGlyphDataForIndex(indexForCharacter(c), g, f);
-    }
-
-    void setGlyphDataForIndex(unsigned index, Glyph glyph, const Font* font)
-    {
</del><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(index &lt; size);
</span><del>-        ASSERT(!m_isImmutable);
-        
</del><span class="cx">         m_glyphs[index] = glyph;
</span><del>-
-        // GlyphPage getters will always return a null Font* for glyph #0 if there's no per-glyph font array.
-        if (hasPerGlyphFontData()) {
-            m_perGlyphFontData[index] = glyph ? font : 0;
-            return;
-        }
-
-        // A single-font GlyphPage already assigned m_fontForAllGlyphs in the constructor.
-        ASSERT(!glyph || font == m_fontForAllGlyphs);
</del><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void setGlyphDataForIndex(unsigned index, const GlyphData&amp; glyphData)
</del><ins>+    const Font&amp; font() const
</ins><span class="cx">     {
</span><del>-        setGlyphDataForIndex(index, glyphData.glyph, glyphData.font);
</del><ins>+        return m_font;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Implemented by the platform.
</span><span class="cx">     bool fill(UChar* characterBuffer, unsigned bufferLength, const Font*);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit GlyphPage(const Font* fontForAllGlyphs)
-        : m_fontForAllGlyphs(fontForAllGlyphs)
</del><ins>+    explicit GlyphPage(const Font&amp; font)
+        : m_font(font)
</ins><span class="cx">     {
</span><del>-        memset(m_glyphs, 0, sizeof(m_glyphs));
-        if (hasPerGlyphFontData())
-            memset(m_perGlyphFontData, 0, sizeof(Font*) * GlyphPage::size);
</del><span class="cx">         ++s_count;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool hasPerGlyphFontData() const { return !m_fontForAllGlyphs; }
</del><ins>+    const Font&amp; m_font;
+    Glyph m_glyphs[size] { };
</ins><span class="cx"> 
</span><del>-    const Font* m_fontForAllGlyphs;
-    Glyph m_glyphs[size];
-
-    bool m_isImmutable { false };
-    // NOTE: This array has (GlyphPage::size) elements if m_fontForAllGlyphs is null.
-    const Font* m_perGlyphFontData[0];
-
</del><span class="cx">     WEBCORE_EXPORT static unsigned s_count;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if COMPILER(MSVC)
-#pragma warning(pop)
-#endif
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // GlyphPage_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeGlyphPageTreeNodeFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -57,9 +57,9 @@
</span><span class="cx"> 
</span><span class="cx">         Glyph glyph = FcFreeTypeCharIndex(face, character);
</span><span class="cx">         if (!glyph)
</span><del>-            setGlyphDataForIndex(i, 0, 0);
</del><ins>+            setGlyphForIndex(i, 0);
</ins><span class="cx">         else {
</span><del>-            setGlyphDataForIndex(i, glyph, fontData);
</del><ins>+            setGlyphForIndex(i, glyph);
</ins><span class="cx">             haveGlyphs = true;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGlyphPageMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -60,23 +60,18 @@
</span><span class="cx"> 
</span><span class="cx"> bool GlyphPage::fill(UChar* buffer, unsigned bufferLength, const Font* fontData)
</span><span class="cx"> {
</span><del>-    bool haveGlyphs = false;
</del><ins>+    ASSERT(fontData == &amp;font());
+    ASSERT(bufferLength == GlyphPage::size || bufferLength == 2 * GlyphPage::size);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;CGGlyph, 512&gt; glyphs(bufferLength);
</span><ins>+    unsigned glyphStep;
</ins><span class="cx">     if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
</span><span class="cx">         // We pass in either 256 or 512 UTF-16 characters: 256 for U+FFFF and less, 512 (double character surrogates)
</span><span class="cx">         // for U+10000 and above. It is indeed possible to get back 512 glyphs back from the API, so the glyph buffer
</span><span class="cx">         // we pass in must be 512. If we get back more than 256 glyphs though we'll ignore all the ones after 256,
</span><span class="cx">         // this should not happen as the only time we pass in 512 characters is when they are surrogates.
</span><span class="cx">         CGFontGetGlyphsForUnichars(fontData-&gt;platformData().cgFont(), buffer, glyphs.data(), bufferLength);
</span><del>-        for (unsigned i = 0; i &lt; GlyphPage::size; ++i) {
-            if (!glyphs[i])
-                setGlyphDataForIndex(i, 0, 0);
-            else {
-                setGlyphDataForIndex(i, glyphs[i], fontData);
-                haveGlyphs = true;
-            }
-        }
</del><ins>+        glyphStep = 1;
</ins><span class="cx">     } else {
</span><span class="cx">         // Because we know the implementation of shouldUseCoreText(), if the font isn't for text combine and it isn't a system font,
</span><span class="cx">         // we know it must have vertical glyphs.
</span><span class="lines">@@ -84,20 +79,19 @@
</span><span class="cx">             CTFontGetGlyphsForCharacters(fontData-&gt;platformData().ctFont(), buffer, glyphs.data(), bufferLength);
</span><span class="cx">         else
</span><span class="cx">             CTFontGetVerticalGlyphsForCharacters(fontData-&gt;platformData().ctFont(), buffer, glyphs.data(), bufferLength);
</span><ins>+
</ins><span class="cx">         // When buffer consists of surrogate pairs, CTFontGetVerticalGlyphsForCharacters and CTFontGetGlyphsForCharacters
</span><span class="cx">         // place the glyphs at indices corresponding to the first character of each pair.
</span><del>-        ASSERT(bufferLength == GlyphPage::size || bufferLength == 2 * GlyphPage::size);
-        unsigned glyphStep = bufferLength / GlyphPage::size;
-        for (unsigned i = 0; i &lt; GlyphPage::size; ++i) {
-            if (!glyphs[i * glyphStep])
-                setGlyphDataForIndex(i, 0, 0);
-            else {
-                setGlyphDataForIndex(i, glyphs[i * glyphStep], fontData);
-                haveGlyphs = true;
-            }
-        }
</del><ins>+        glyphStep = bufferLength / GlyphPage::size;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    bool haveGlyphs = false;
+    for (unsigned i = 0; i &lt; GlyphPage::size; ++i) {
+        if (glyphs[i * glyphStep]) {
+            setGlyphForIndex(i, glyphs[i * glyphStep]);
+            haveGlyphs = true;
+        }
+    }
</ins><span class="cx">     return haveGlyphs;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopentypeOpenTypeVerticalDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -542,12 +542,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned index = 0; index &lt; GlyphPage::size; ++index) {
</span><del>-        Glyph glyph = glyphPage-&gt;glyphAt(index);
</del><ins>+        Glyph glyph = glyphPage-&gt;glyphForIndex(index);
</ins><span class="cx">         if (glyph) {
</span><del>-            ASSERT(glyphPage-&gt;glyphDataForIndex(index).font == font);
</del><ins>+            ASSERT_UNUSED(font, &amp;glyphPage-&gt;font() == font);
</ins><span class="cx">             Glyph to = map.get(glyph);
</span><span class="cx">             if (to)
</span><del>-                glyphPage-&gt;setGlyphDataForIndex(index, to, font);
</del><ins>+                glyphPage-&gt;setGlyphForIndex(index, to);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -47,9 +47,9 @@
</span><span class="cx">     for (unsigned i = 0; i &lt; GlyphPage::size; i++) {
</span><span class="cx">         Glyph glyph = localGlyphBuffer[i];
</span><span class="cx">         if (!glyph)
</span><del>-            setGlyphDataForIndex(i, 0, 0);
</del><ins>+            setGlyphForIndex(i, 0);
</ins><span class="cx">         else {
</span><del>-            setGlyphDataForIndex(i, glyph, fontData);
</del><ins>+            setGlyphForIndex(i, glyph);
</ins><span class="cx">             haveGlyphs = true;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCairoWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -54,9 +54,9 @@
</span><span class="cx">         for (unsigned i = 0; i &lt; GlyphPage::size; i++) {
</span><span class="cx">             Glyph glyph = localGlyphBuffer[i];
</span><span class="cx">             if (glyph == 0xffff)
</span><del>-                setGlyphDataForIndex(i, 0, 0);
</del><ins>+                setGlyphForIndex(i, 0);
</ins><span class="cx">             else {
</span><del>-                setGlyphDataForIndex(i, glyph, fontData);
</del><ins>+                setGlyphForIndex(i, glyph);
</ins><span class="cx">                 haveGlyphs = true;
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontData.cpp (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontData.cpp        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/svg/SVGFontData.cpp        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -204,11 +204,8 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGFontData::fillSVGGlyphPage(GlyphPage* pageToFill, UChar* buffer, unsigned bufferLength, const Font* font) const
</del><ins>+bool SVGFontData::fillSVGGlyphPage(GlyphPage* pageToFill, UChar* buffer, unsigned bufferLength) const
</ins><span class="cx"> {
</span><del>-    ASSERT(font-&gt;isCustomFont());
-    ASSERT(font-&gt;isSVGFont());
-
</del><span class="cx">     SVGFontFaceElement* fontFaceElement = this-&gt;svgFontFaceElement();
</span><span class="cx">     ASSERT(fontFaceElement);
</span><span class="cx"> 
</span><span class="lines">@@ -216,13 +213,13 @@
</span><span class="cx">     ASSERT(fontElement);
</span><span class="cx"> 
</span><span class="cx">     if (bufferLength == GlyphPage::size)
</span><del>-        return fillBMPGlyphs(fontElement, pageToFill, buffer, font);
</del><ins>+        return fillBMPGlyphs(fontElement, pageToFill, buffer);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(bufferLength == 2 * GlyphPage::size);
</span><del>-    return fillNonBMPGlyphs(fontElement, pageToFill, buffer, font);
</del><ins>+    return fillNonBMPGlyphs(fontElement, pageToFill, buffer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGFontData::fillBMPGlyphs(SVGFontElement* fontElement, GlyphPage* pageToFill, UChar* buffer, const Font* font) const
</del><ins>+bool SVGFontData::fillBMPGlyphs(SVGFontElement* fontElement, GlyphPage* pageToFill, UChar* buffer) const
</ins><span class="cx"> {
</span><span class="cx">     bool haveGlyphs = false;
</span><span class="cx">     Vector&lt;SVGGlyph&gt; glyphs;
</span><span class="lines">@@ -230,7 +227,7 @@
</span><span class="cx">         String lookupString(buffer + i, 1);
</span><span class="cx">         fontElement-&gt;collectGlyphsForString(lookupString, glyphs);
</span><span class="cx">         if (glyphs.isEmpty()) {
</span><del>-            pageToFill-&gt;setGlyphDataForIndex(i, 0, 0);
</del><ins>+            pageToFill-&gt;setGlyphForIndex(i, 0);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -239,14 +236,14 @@
</span><span class="cx">         // care of matching to the correct glyph, if multiple ones are available, as that's
</span><span class="cx">         // only possible within the context of a string (eg. arabic form matching).
</span><span class="cx">         haveGlyphs = true;
</span><del>-        pageToFill-&gt;setGlyphDataForIndex(i, glyphs.first().tableEntry, font);
</del><ins>+        pageToFill-&gt;setGlyphForIndex(i, glyphs.first().tableEntry);
</ins><span class="cx">         glyphs.clear();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return haveGlyphs;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGFontData::fillNonBMPGlyphs(SVGFontElement* fontElement, GlyphPage* pageToFill, UChar* buffer, const Font* font) const
</del><ins>+bool SVGFontData::fillNonBMPGlyphs(SVGFontElement* fontElement, GlyphPage* pageToFill, UChar* buffer) const
</ins><span class="cx"> {
</span><span class="cx">     bool haveGlyphs = false;
</span><span class="cx">     Vector&lt;SVGGlyph&gt; glyphs;
</span><span class="lines">@@ -255,7 +252,7 @@
</span><span class="cx">         String lookupString(buffer + i * 2, 2);
</span><span class="cx">         fontElement-&gt;collectGlyphsForString(lookupString, glyphs);
</span><span class="cx">         if (glyphs.isEmpty()) {
</span><del>-            pageToFill-&gt;setGlyphDataForIndex(i, 0, 0);
</del><ins>+            pageToFill-&gt;setGlyphForIndex(i, 0);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -264,7 +261,7 @@
</span><span class="cx">         // care of matching to the correct glyph, if multiple ones are available, as that's
</span><span class="cx">         // only possible within the context of a string (eg. arabic form matching).
</span><span class="cx">         haveGlyphs = true;
</span><del>-        pageToFill-&gt;setGlyphDataForIndex(i, glyphs.first().tableEntry, font);
</del><ins>+        pageToFill-&gt;setGlyphForIndex(i, glyphs.first().tableEntry);
</ins><span class="cx">         glyphs.clear();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontData.h (189538 => 189539)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontData.h        2015-09-09 11:23:07 UTC (rev 189538)
+++ trunk/Source/WebCore/svg/SVGFontData.h        2015-09-09 12:26:08 UTC (rev 189539)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void initializeFont(Font*, float fontSize) override;
</span><span class="cx">     virtual float widthForSVGGlyph(Glyph, float fontSize) const override;
</span><del>-    virtual bool fillSVGGlyphPage(GlyphPage*, UChar* buffer, unsigned bufferLength, const Font*) const override;
</del><ins>+    virtual bool fillSVGGlyphPage(GlyphPage*, UChar* buffer, unsigned bufferLength) const override;
</ins><span class="cx"> 
</span><span class="cx">     bool applySVGGlyphSelection(WidthIterator&amp;, GlyphData&amp;, bool mirror, int currentCharacter, unsigned&amp; advanceLength, String&amp; normalizedSpacesStringCache) const;
</span><span class="cx"> 
</span><span class="lines">@@ -50,8 +50,8 @@
</span><span class="cx">     float verticalAdvanceY() const { return m_verticalAdvanceY; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool fillBMPGlyphs(SVGFontElement*, GlyphPage*, UChar* buffer, const Font*) const;
-    bool fillNonBMPGlyphs(SVGFontElement*, GlyphPage*, UChar* buffer, const Font*) const;
</del><ins>+    bool fillBMPGlyphs(SVGFontElement*, GlyphPage*, UChar* buffer) const;
+    bool fillNonBMPGlyphs(SVGFontElement*, GlyphPage*, UChar* buffer) const;
</ins><span class="cx"> 
</span><span class="cx">     bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, TypesettingFeatures) const = delete;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>