<!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>[185205] 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/185205">185205</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2015-06-04 11:18:23 -0700 (Thu, 04 Jun 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Cocoa] Clean up m_isEmoji in FontPlatformData
https://bugs.webkit.org/show_bug.cgi?id=145644
Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-06-04
Reviewed by Andreas Kling.
m_isEmoji used to be a public member variable only defined on iOS. This
means that, whenever it was consulted, the sites were surrounded by
PLATFORM(IOS) guards. A cleaner design is to use a getter and setter,
which on non-iOS platforms, always return false / do nothing. Then, the
use sites can just use these functions without having ugly guards.
No new tests because there is no behavior change.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash): Simplify isEmoji use site.
(WebCore::FontPlatformData::isEmoji): Getter. Returns false on Mac.
(WebCore::FontPlatformData::setIsEmoji): Setter. Does nothing on Mac.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::pointAdjustedForEmoji): Simplify isEmoji use site.
(WebCore::FontCascade::drawGlyphs): Ditto.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit): Ditto.
(WebCore::canUseFastGlyphAdvanceGetter): Ditto.
(WebCore::isEmoji): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::platformDataInit): Simplify isEmoji use
site.
(WebCore::FontPlatformData::platformDataAssign): Ditto.
(WebCore::FontPlatformData::platformIsEqual): Ditto.
(WebCore::FontPlatformData::ctFontSize): Ditto.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getSystemFontFallbackForCharacters): Ditto.
(WebCore::FontCache::createFontPlatformData): Ditto.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatah">trunk/Source/WebCore/platform/graphics/FontPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCascadeCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm">trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/ChangeLog        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-06-04 Myles C. Maxfield <mmaxfield@apple.com>
+
+ [Cocoa] Clean up m_isEmoji in FontPlatformData
+ https://bugs.webkit.org/show_bug.cgi?id=145644
+
+ Reviewed by Andreas Kling.
+
+ m_isEmoji used to be a public member variable only defined on iOS. This
+ means that, whenever it was consulted, the sites were surrounded by
+ PLATFORM(IOS) guards. A cleaner design is to use a getter and setter,
+ which on non-iOS platforms, always return false / do nothing. Then, the
+ use sites can just use these functions without having ugly guards.
+
+ No new tests because there is no behavior change.
+
+ * platform/graphics/FontPlatformData.h:
+ (WebCore::FontPlatformData::hash): Simplify isEmoji use site.
+ (WebCore::FontPlatformData::isEmoji): Getter. Returns false on Mac.
+ (WebCore::FontPlatformData::setIsEmoji): Setter. Does nothing on Mac.
+ * platform/graphics/cocoa/FontCascadeCocoa.mm:
+ (WebCore::pointAdjustedForEmoji): Simplify isEmoji use site.
+ (WebCore::FontCascade::drawGlyphs): Ditto.
+ * platform/graphics/cocoa/FontCocoa.mm:
+ (WebCore::Font::platformInit): Ditto.
+ (WebCore::canUseFastGlyphAdvanceGetter): Ditto.
+ (WebCore::isEmoji): Deleted.
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+ (WebCore::FontPlatformData::platformDataInit): Simplify isEmoji use
+ site.
+ (WebCore::FontPlatformData::platformDataAssign): Ditto.
+ (WebCore::FontPlatformData::platformIsEqual): Ditto.
+ (WebCore::FontPlatformData::ctFontSize): Ditto.
+ * platform/graphics/ios/FontCacheIOS.mm:
+ (WebCore::FontCache::getSystemFontFallbackForCharacters): Ditto.
+ (WebCore::FontCache::createFontPlatformData): Ditto.
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto.
+
</ins><span class="cx"> 2015-06-03 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -149,13 +149,14 @@
</span><span class="cx"> #if PLATFORM(WIN) && !USE(CAIRO)
</span><span class="cx"> return m_font ? m_font->hash() : 0;
</span><span class="cx"> #elif OS(DARWIN)
</span><ins>+ ASSERT(m_font || !m_cgFont || isEmoji());
+ uintptr_t flags = static_cast<uintptr_t>(m_isHashTableDeletedValue << 4 | isEmoji() << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique);
</ins><span class="cx"> #if USE(APPKIT)
</span><del>- ASSERT(m_font || !m_cgFont);
- uintptr_t hashCodes[3] = { reinterpret_cast<uintptr_t>(const_cast<__CTFont*>(m_font.get())), m_widthVariant, static_cast<uintptr_t>(m_isHashTableDeletedValue << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique) };
</del><ins>+ uintptr_t fontHash = reinterpret_cast<uintptr_t>(const_cast<__CTFont*>(m_font.get()));
</ins><span class="cx"> #else
</span><del>- ASSERT(m_font || !m_cgFont || m_isEmoji);
- uintptr_t hashCodes[3] = { static_cast<uintptr_t>(CFHash(m_font.get())), m_widthVariant, static_cast<uintptr_t>(m_isHashTableDeletedValue << 4 | m_isEmoji << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique) };
</del><ins>+ uintptr_t fontHash = reinterpret_cast<uintptr_t>(CFHash(m_font.get()));
</ins><span class="cx"> #endif
</span><ins>+ uintptr_t hashCodes[3] = { fontHash, m_widthVariant, flags };
</ins><span class="cx"> return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
</span><span class="cx"> #elif USE(CAIRO)
</span><span class="cx"> return PtrHash<cairo_scaled_font_t*>::hash(m_scaledFont);
</span><span class="lines">@@ -190,6 +191,14 @@
</span><span class="cx"> String description() const;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+ bool isEmoji() const { return m_isEmoji; }
+ void setIsEmoji(bool isEmoji) { m_isEmoji = isEmoji; }
+#elif PLATFORM(MAC)
+ bool isEmoji() const { return false; }
+ void setIsEmoji(bool) { }
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx"> bool platformIsEqual(const FontPlatformData&) const;
</span><span class="cx"> void platformDataInit(const FontPlatformData&);
</span><span class="lines">@@ -205,9 +214,6 @@
</span><span class="cx"> bool m_syntheticBold { false };
</span><span class="cx"> bool m_syntheticOblique { false };
</span><span class="cx"> FontOrientation m_orientation { Horizontal };
</span><del>-#if PLATFORM(IOS)
- bool m_isEmoji { false };
-#endif
</del><span class="cx"> float m_size { 0 };
</span><span class="cx"> FontWidthVariant m_widthVariant { RegularWidth };
</span><span class="cx">
</span><span class="lines">@@ -230,6 +236,9 @@
</span><span class="cx"> bool m_isColorBitmapFont { false };
</span><span class="cx"> bool m_isCompositeFontReference { false };
</span><span class="cx"> bool m_isHashTableDeletedValue { false };
</span><ins>+#if PLATFORM(IOS)
+ bool m_isEmoji { false };
+#endif
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> bool m_useGDI { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCascadeCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -246,10 +246,19 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-static FloatPoint pointAdjustedForEmoji(const FontPlatformData& platformData, FloatPoint point)
</del><ins>+static inline bool isOnOrAfterIOS6()
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- if (!platformData.m_isEmoji)
</del><ins>+ return iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_6_0);
+#else
+ ASSERT_NOT_REACHED();
+ return false;
+#endif
+}
+
+static FloatPoint pointAdjustedForEmoji(const FontPlatformData& platformData, FloatPoint point)
+{
+ if (!platformData.isEmoji())
</ins><span class="cx"> return point;
</span><span class="cx">
</span><span class="cx"> // Mimic the positioining of non-bitmap glyphs, which are not subpixel-positioned.
</span><span class="lines">@@ -266,19 +275,16 @@
</span><span class="cx"> float y = point.y();
</span><span class="cx"> if (fontSize <= 15) {
</span><span class="cx"> // Undo Core Text's y adjustment.
</span><del>- static float yAdjustmentFactor = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_6_0) ? .19 : .1;
</del><ins>+ static float yAdjustmentFactor = isOnOrAfterIOS6() ? .19 : .1;
</ins><span class="cx"> point.setY(floorf(y - yAdjustmentFactor * (fontSize + 2) + 2));
</span><span class="cx"> } else {
</span><span class="cx"> if (fontSize < 26)
</span><span class="cx"> y -= .35f * fontSize - 10;
</span><span class="cx">
</span><span class="cx"> // Undo Core Text's y adjustment.
</span><del>- static float yAdjustment = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_6_0) ? 3.8 : 2;
</del><ins>+ static float yAdjustment = isOnOrAfterIOS6() ? 3.8 : 2;
</ins><span class="cx"> point.setY(floorf(y - yAdjustment));
</span><span class="cx"> }
</span><del>-#else
- UNUSED_PARAM(platformData);
-#endif
</del><span class="cx"> return point;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -416,11 +422,7 @@
</span><span class="cx"> // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
</span><span class="cx"> float shadowTextY = point.y() + shadowOffset.height() * (context->shadowsIgnoreTransforms() ? -1 : 1);
</span><span class="cx"> showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
</span><del>-#if !PLATFORM(IOS)
- if (syntheticBoldOffset)
-#else
- if (syntheticBoldOffset && !platformData.m_isEmoji)
-#endif
</del><ins>+ if (syntheticBoldOffset && !platformData.isEmoji())
</ins><span class="cx"> showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
</span><span class="cx"> context->setFillColor(fillColor, fillColorSpace);
</span><span class="cx"> }
</span><span class="lines">@@ -429,11 +431,7 @@
</span><span class="cx"> showLetterpressedGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
</span><span class="cx"> else
</span><span class="cx"> showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
</span><del>-#if !PLATFORM(IOS)
- if (syntheticBoldOffset)
-#else
- if (syntheticBoldOffset && !platformData.m_isEmoji)
-#endif
</del><ins>+ if (syntheticBoldOffset && !platformData.isEmoji())
</ins><span class="cx"> showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
</span><span class="cx">
</span><span class="cx"> if (hasSimpleShadow)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx"> if (platformData().orientation() == Vertical && !isTextOrientationFallback())
</span><span class="cx"> m_hasVerticalGlyphs = fontHasVerticalGlyphs(m_platformData.ctFont());
</span><span class="cx">
</span><del>- if (m_platformData.m_isEmoji) {
</del><ins>+ if (m_platformData.isEmoji()) {
</ins><span class="cx"> int thirdOfSize = m_platformData.size() / 3;
</span><span class="cx"> m_fontMetrics.setAscent(thirdOfSize);
</span><span class="cx"> m_fontMetrics.setDescent(thirdOfSize);
</span><span class="lines">@@ -455,16 +455,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline bool isEmoji(const FontPlatformData& platformData)
-{
-#if PLATFORM(IOS)
- return platformData.m_isEmoji;
-#else
- UNUSED_PARAM(platformData);
- return false;
-#endif
-}
-
</del><span class="cx"> static inline bool canUseFastGlyphAdvanceGetter(const Font& font, Glyph glyph, CGSize& advance, bool& populatedAdvance)
</span><span class="cx"> {
</span><span class="cx"> const FontPlatformData& platformData = font.platformData();
</span><span class="lines">@@ -472,7 +462,7 @@
</span><span class="cx"> if (font.hasCustomTracking())
</span><span class="cx"> return false;
</span><span class="cx"> // Fast getter doesn't work for emoji
</span><del>- if (isEmoji(platformData))
</del><ins>+ if (platformData.isEmoji())
</ins><span class="cx"> return false;
</span><span class="cx"> // ... or for any bitmap fonts in general
</span><span class="cx"> if (advanceForColorBitmapFont(platformData, glyph, advance)) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -58,9 +58,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_font = f.m_font;
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
- m_isEmoji = f.m_isEmoji;
-#endif
</del><ins>+ setIsEmoji(f.isEmoji());
</ins><span class="cx"> m_cgFont = f.m_cgFont;
</span><span class="cx"> m_ctFont = f.m_ctFont;
</span><span class="cx"> }
</span><span class="lines">@@ -68,9 +66,7 @@
</span><span class="cx"> const FontPlatformData& FontPlatformData::platformDataAssign(const FontPlatformData& f)
</span><span class="cx"> {
</span><span class="cx"> m_cgFont = f.m_cgFont;
</span><del>-#if PLATFORM(IOS)
- m_isEmoji = f.m_isEmoji;
-#endif
</del><ins>+ setIsEmoji(f.isEmoji());
</ins><span class="cx"> if (m_font && f.m_font && CFEqual(m_font.get(), f.m_font.get()))
</span><span class="cx"> return *this;
</span><span class="cx"> m_font = f.m_font;
</span><span class="lines">@@ -85,19 +81,13 @@
</span><span class="cx"> if (m_font || other.m_font) {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> result = m_font && other.m_font && CFEqual(m_font.get(), other.m_font.get());
</span><del>-#if !ASSERT_DISABLED
- if (result)
- ASSERT(m_isEmoji == other.m_isEmoji);
-#endif
</del><span class="cx"> #else
</span><span class="cx"> result = m_font == other.m_font;
</span><span class="cx"> #endif
</span><ins>+ ASSERT(!result || isEmoji() == other.isEmoji());
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><del>-#if PLATFORM(IOS) && !ASSERT_DISABLED
- if (m_cgFont == other.m_cgFont)
- ASSERT(m_isEmoji == other.m_isEmoji);
-#endif
</del><ins>+ ASSERT(m_cgFont != other.m_cgFont || isEmoji() == other.isEmoji());
</ins><span class="cx"> return m_cgFont == other.m_cgFont;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -202,12 +192,8 @@
</span><span class="cx">
</span><span class="cx"> CGFloat FontPlatformData::ctFontSize() const
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // Apple Color Emoji size is adjusted (and then re-adjusted by Core Text) and capped.
- return !m_isEmoji ? m_size : m_size <= 15 ? 4 * (m_size + 2) / static_cast<CGFloat>(5) : 16;
-#else
- return m_size;
-#endif
</del><ins>+ // On iOS, Apple Color Emoji size is adjusted (and then re-adjusted by Core Text) and capped.
+ return !isEmoji() ? m_size : m_size <= 15 ? 4 * (m_size + 2) / static_cast<CGFloat>(5) : 16;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CTFontRef FontPlatformData::ctFont() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> bool syntheticOblique = (originalTraits & kCTFontTraitItalic) && !(actualTraits & kCTFontTraitItalic);
</span><span class="cx">
</span><span class="cx"> FontPlatformData alternateFont(substituteFont.get(), platformData.size(), syntheticBold, syntheticOblique, platformData.m_orientation);
</span><del>- alternateFont.m_isEmoji = CTFontIsAppleColorEmoji(substituteFont.get());
</del><ins>+ alternateFont.setIsEmoji(CTFontIsAppleColorEmoji(substituteFont.get()));
</ins><span class="cx">
</span><span class="cx"> return fontForPlatformData(alternateFont);
</span><span class="cx"> }
</span><span class="lines">@@ -698,7 +698,7 @@
</span><span class="cx">
</span><span class="cx"> auto result = std::make_unique<FontPlatformData>(ctFont.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
</span><span class="cx"> if (isAppleColorEmoji)
</span><del>- result->m_isEmoji = true;
</del><ins>+ result->setIsEmoji(true);
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (185204 => 185205)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2015-06-04 18:09:54 UTC (rev 185204)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2015-06-04 18:18:23 UTC (rev 185205)
</span><span class="lines">@@ -603,9 +603,7 @@
</span><span class="cx"> ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
</span><span class="cx"> unsigned glyphCount = complexTextRun.glyphCount();
</span><span class="cx"> const Font& font = complexTextRun.font();
</span><del>-#if PLATFORM(IOS)
- bool isEmoji = font.platformData().m_isEmoji;
-#endif
</del><ins>+ bool isEmoji = font.platformData().isEmoji();
</ins><span class="cx">
</span><span class="cx"> // Represent the initial advance for a text run by adjusting the advance
</span><span class="cx"> // of the last glyph of the previous text run in the glyph buffer.
</span><span class="lines">@@ -653,10 +651,8 @@
</span><span class="cx"> bool treatAsSpace = FontCascade::treatAsSpace(ch);
</span><span class="cx"> CGGlyph glyph = treatAsSpace ? font.spaceGlyph() : glyphs[i];
</span><span class="cx"> CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> if (isEmoji && advance.width)
</span><span class="cx"> advance.width = font.widthForGlyph(glyph);
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> if (ch == '\t' && m_run.allowTabs())
</span><span class="cx"> advance.width = m_font.tabWidth(font, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
</span></span></pre>
</div>
</div>
</body>
</html>