<!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>[200129] trunk/Source</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/200129">200129</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-04-27 09:47:13 -0700 (Wed, 27 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/200094">r200094</a>): [FreeType] Vertical text is broken after <a href="http://trac.webkit.org/projects/webkit/changeset/200094">r200094</a>
https://bugs.webkit.org/show_bug.cgi?id=157066

Reviewed by Martin Robinson.

Source/WebCore:

The problem is that Freetype implementation needs to call buildScaledFont() when orientation, SyntheticOblique
or size change, but the new static clone methods don't do that. I think it's the time to stop using our own
header for FontPlatformData for the FreeType implementation to make cross-platform changes easier and prevent
regressions like this in the future.

* CMakeLists.txt: Compile FontPlatformData.cpp for all ports.
* PlatformMac.cmake: Remove FontPlatformData.cpp.
* PlatformWin.cmake: Ditto.
* platform/graphics/FontPlatformData.cpp: We need our own clone methods in the FreeType backend.
* platform/graphics/FontPlatformData.h: Move FreeType specific methods and members from the old header file.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Move CairoFtFaceLocker implementation here from
HarfBuzzFaceCairo.cpp to make it available to other classes, and make it handle the case of
cairo_ft_scaled_font_lock_face() returning nullptr.
(WebCore::CairoFtFaceLocker::~CairoFtFaceLocker):
* platform/graphics/cairo/CairoUtilities.h:
(WebCore::CairoFtFaceLocker::ftFace):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::findBestFontGivenFallbacks): Move the fallbacks implementation to FontPlatformData where it belongs
and here simply use FontPlatformData::fallbacks().
* platform/graphics/freetype/FontPlatformData.h: Removed.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::FontPlatformData): Remove members already initialized in the header.
(WebCore::FontPlatformData::operator=): Add missing members to be copied.
(WebCore::FontPlatformData::~FontPlatformData): Do not free m_scaledFont manually since we are now using a smart pointer.
(WebCore::FontPlatformData::cloneWithOrientation): Call buildScaledFont() like setOrientation() did.
(WebCore::FontPlatformData::cloneWithSyntheticOblique): Call buildScaledFont() like setSyntheticOblique() did.
(WebCore::FontPlatformData::cloneWithSize): Call buildScaledFont().
(WebCore::FontPlatformData::fallbacks): Lazily initialize fallbacks if needed and return it.
(WebCore::FontPlatformData::platformIsEqual): Only compare FreeType specific members.
(WebCore::FontPlatformData::buildScaledFont): Use RefPtr for m_scaledFont.
(WebCore::FontPlatformData::hasCompatibleCharmap): Use CairoFtFaceLocker.
(WebCore::FontPlatformData::openTypeTable): Update to return RefPtr instead of PassRefPtr and use CairoFtFaceLocker.
(WebCore::FontPlatformData::operator==): Deleted.
(WebCore::FontPlatformData::setOrientation): Deleted.
(WebCore::FontPlatformData::setSyntheticOblique): Deleted.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill): Use CairoFtFaceLocker.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit): Ditto.
(WebCore::Font::canRenderCombiningCharacterSequence): Ditto.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzCairoGetTable): Ditto.
(WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Deleted.
(WebCore::CairoFtFaceLocker::lock): Deleted.
(WebCore::CairoFtFaceLocker::~CairoFtFaceLocker): Deleted.

Source/WebKit2:

Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
includes FcUniquePtr.h.

* PlatformEfl.cmake:
* PlatformGTK.cmake:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformWincmake">trunk/Source/WebCore/PlatformWin.cmake</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp">trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatah">trunk/Source/WebCore/platform/graphics/FontPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoCairoUtilitiesh">trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeGlyphPageTreeNodeFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeSimpleFontDataFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsharfbuzzHarfBuzzFaceCairocpp">trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformEflcmake">trunk/Source/WebKit2/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDatah">trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -2203,6 +2203,7 @@
</span><span class="cx">     platform/graphics/FontDescription.cpp
</span><span class="cx">     platform/graphics/FontFeatureSettings.cpp
</span><span class="cx">     platform/graphics/FontGenericFamilies.cpp
</span><ins>+    platform/graphics/FontPlatformData.cpp
</ins><span class="cx">     platform/graphics/FontRanges.cpp
</span><span class="cx">     platform/graphics/GeneratedImage.cpp
</span><span class="cx">     platform/graphics/GeometryUtilities.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/ChangeLog        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2016-04-27  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
+        https://bugs.webkit.org/show_bug.cgi?id=157066
+
+        Reviewed by Martin Robinson.
+
+        The problem is that Freetype implementation needs to call buildScaledFont() when orientation, SyntheticOblique
+        or size change, but the new static clone methods don't do that. I think it's the time to stop using our own
+        header for FontPlatformData for the FreeType implementation to make cross-platform changes easier and prevent
+        regressions like this in the future.
+
+        * CMakeLists.txt: Compile FontPlatformData.cpp for all ports.
+        * PlatformMac.cmake: Remove FontPlatformData.cpp.
+        * PlatformWin.cmake: Ditto.
+        * platform/graphics/FontPlatformData.cpp: We need our own clone methods in the FreeType backend.
+        * platform/graphics/FontPlatformData.h: Move FreeType specific methods and members from the old header file.
+        * platform/graphics/cairo/CairoUtilities.cpp:
+        (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Move CairoFtFaceLocker implementation here from
+        HarfBuzzFaceCairo.cpp to make it available to other classes, and make it handle the case of
+        cairo_ft_scaled_font_lock_face() returning nullptr.
+        (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker):
+        * platform/graphics/cairo/CairoUtilities.h:
+        (WebCore::CairoFtFaceLocker::ftFace):
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::findBestFontGivenFallbacks): Move the fallbacks implementation to FontPlatformData where it belongs
+        and here simply use FontPlatformData::fallbacks().
+        * platform/graphics/freetype/FontPlatformData.h: Removed.
+        * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
+        (WebCore::FontPlatformData::FontPlatformData): Remove members already initialized in the header.
+        (WebCore::FontPlatformData::operator=): Add missing members to be copied.
+        (WebCore::FontPlatformData::~FontPlatformData): Do not free m_scaledFont manually since we are now using a smart pointer.
+        (WebCore::FontPlatformData::cloneWithOrientation): Call buildScaledFont() like setOrientation() did.
+        (WebCore::FontPlatformData::cloneWithSyntheticOblique): Call buildScaledFont() like setSyntheticOblique() did.
+        (WebCore::FontPlatformData::cloneWithSize): Call buildScaledFont().
+        (WebCore::FontPlatformData::fallbacks): Lazily initialize fallbacks if needed and return it.
+        (WebCore::FontPlatformData::platformIsEqual): Only compare FreeType specific members.
+        (WebCore::FontPlatformData::buildScaledFont): Use RefPtr for m_scaledFont.
+        (WebCore::FontPlatformData::hasCompatibleCharmap): Use CairoFtFaceLocker.
+        (WebCore::FontPlatformData::openTypeTable): Update to return RefPtr instead of PassRefPtr and use CairoFtFaceLocker.
+        (WebCore::FontPlatformData::operator==): Deleted.
+        (WebCore::FontPlatformData::setOrientation): Deleted.
+        (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
+        * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
+        (WebCore::GlyphPage::fill): Use CairoFtFaceLocker.
+        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+        (WebCore::Font::platformInit): Ditto.
+        (WebCore::Font::canRenderCombiningCharacterSequence): Ditto.
+        * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
+        (WebCore::harfBuzzCairoGetTable): Ditto.
+        (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Deleted.
+        (WebCore::CairoFtFaceLocker::lock): Deleted.
+        (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker): Deleted.
+
</ins><span class="cx"> 2016-04-27  Hunseop Jeong  &lt;hs85.jeong@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -348,7 +348,6 @@
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/DisplayRefreshMonitor.cpp
</span><span class="cx">     platform/graphics/DisplayRefreshMonitorManager.cpp
</span><del>-    platform/graphics/FontPlatformData.cpp
</del><span class="cx"> 
</span><span class="cx">     platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm
</span><span class="cx">     platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWin.cmake (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWin.cmake        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/PlatformWin.cmake        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx"> 
</span><span class="cx">     platform/crypto/win/CryptoDigestWin.cpp
</span><span class="cx"> 
</span><del>-    platform/graphics/FontPlatformData.cpp
</del><span class="cx">     platform/graphics/GraphicsContext3DPrivate.cpp
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/egl/GLContextEGL.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !USE(FREETYPE)
</ins><span class="cx"> FontPlatformData FontPlatformData::cloneWithOrientation(const FontPlatformData&amp; source, FontOrientation orientation)
</span><span class="cx"> {
</span><span class="cx">     FontPlatformData copy(source);
</span><span class="lines">@@ -82,5 +83,6 @@
</span><span class="cx">     copy.m_size = size;
</span><span class="cx">     return copy;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -22,11 +22,6 @@
</span><span class="cx">  *
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-// FIXME: This is temporary until all ports switch to using this file.
-#if PLATFORM(EFL) || PLATFORM(GTK)
-#include &quot;freetype/FontPlatformData.h&quot;
-#else
-
</del><span class="cx"> #ifndef FontPlatformData_h
</span><span class="cx"> #define FontPlatformData_h
</span><span class="cx"> 
</span><span class="lines">@@ -42,6 +37,12 @@
</span><span class="cx"> #include &lt;cairo.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE)
+#include &quot;FcUniquePtr.h&quot;
+#include &quot;HarfBuzzFace.h&quot;
+#include &quot;OpenTypeVerticalData.h&quot;
+#endif
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #import &lt;CoreGraphics/CoreGraphics.h&gt;
</span><span class="lines">@@ -81,7 +82,9 @@
</span><span class="cx"> public:
</span><span class="cx">     FontPlatformData(WTF::HashTableDeletedValueType);
</span><span class="cx">     FontPlatformData();
</span><ins>+#if !USE(FREETYPE)
</ins><span class="cx">     FontPlatformData(const FontPlatformData&amp;) = default;
</span><ins>+#endif
</ins><span class="cx">     FontPlatformData(FontPlatformData&amp;&amp;) = default;
</span><span class="cx">     FontPlatformData(const FontDescription&amp;, const AtomicString&amp; family);
</span><span class="cx">     FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, TextRenderingMode = AutoTextRendering);
</span><span class="lines">@@ -108,6 +111,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE)
+    FontPlatformData(FcPattern*, const FontDescription&amp;);
+    FontPlatformData(cairo_font_face_t*, const FontDescription&amp;, bool syntheticBold, bool syntheticOblique);
+    FontPlatformData(const FontPlatformData&amp;);
+    ~FontPlatformData();
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     HFONT hfont() const { return m_font ? m_font-&gt;get() : 0; }
</span><span class="cx">     bool useGDI() const { return m_useGDI; }
</span><span class="lines">@@ -149,6 +159,13 @@
</span><span class="cx">     cairo_scaled_font_t* scaledFont() const { return m_scaledFont.get(); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE)
+    HarfBuzzFace* harfBuzzFace() const;
+    bool hasCompatibleCharmap() const;
+    PassRefPtr&lt;OpenTypeVerticalData&gt; verticalData() const;
+    FcFontSet* fallbacks() const;
+#endif
+
</ins><span class="cx">     unsigned hash() const
</span><span class="cx">     {
</span><span class="cx"> #if PLATFORM(WIN) &amp;&amp; !USE(CAIRO)
</span><span class="lines">@@ -167,7 +184,11 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE)
+    FontPlatformData&amp; operator=(const FontPlatformData&amp;);
+#else
</ins><span class="cx">     FontPlatformData&amp; operator=(const FontPlatformData&amp;) = default;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool operator==(const FontPlatformData&amp; other) const
</span><span class="cx">     {
</span><span class="lines">@@ -196,7 +217,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA) || PLATFORM(WIN)
</del><ins>+#if PLATFORM(COCOA) || PLATFORM(WIN) || USE(FREETYPE)
</ins><span class="cx">     RefPtr&lt;SharedBuffer&gt; openTypeTable(uint32_t table) const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -212,6 +233,9 @@
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
</span><span class="cx"> #endif
</span><ins>+#if USE(FREETYPE)
+    void buildScaledFont(cairo_font_face_t*);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // FIXME: Get rid of one of these. These two fonts are subtly different, and it is not obvious which one to use where.
</span><span class="lines">@@ -227,6 +251,11 @@
</span><span class="cx"> #if USE(CAIRO)
</span><span class="cx">     RefPtr&lt;cairo_scaled_font_t&gt; m_scaledFont;
</span><span class="cx"> #endif
</span><ins>+#if USE(FREETYPE)
+    RefPtr&lt;FcPattern&gt; m_pattern;
+    mutable FcUniquePtr&lt;FcFontSet&gt; m_fallbacks;
+    mutable RefPtr&lt;HarfBuzzFace&gt; m_harfBuzzFace;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     // The values below are common to all ports
</span><span class="cx">     // FIXME: If they're common to all ports, they should move to Font
</span><span class="lines">@@ -249,6 +278,9 @@
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     bool m_useGDI { false };
</span><span class="cx"> #endif
</span><ins>+#if USE(FREETYPE)
+    bool m_fixedWidth { false };
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #if USE(APPKIT)
</span><span class="lines">@@ -267,5 +299,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // FontPlatformData_h
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoCairoUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -36,6 +36,10 @@
</span><span class="cx"> // This function was added pretty much simultaneous to when 1.13 was branched.
</span><span class="cx"> #define HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE CAIRO_VERSION_MAJOR &gt; 1 || (CAIRO_VERSION_MAJOR == 1 &amp;&amp; CAIRO_VERSION_MINOR &gt;= 13)
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE)
+#include &lt;cairo-ft.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> class AffineTransform;
</span><span class="cx"> class Color;
</span><span class="lines">@@ -46,6 +50,29 @@
</span><span class="cx"> class Path;
</span><span class="cx"> class Region;
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE)
+class CairoFtFaceLocker {
+public:
+    CairoFtFaceLocker(cairo_scaled_font_t* scaledFont)
+        : m_scaledFont(scaledFont)
+        , m_ftFace(cairo_ft_scaled_font_lock_face(scaledFont))
+    {
+    }
+
+    ~CairoFtFaceLocker()
+    {
+        if (m_ftFace)
+            cairo_ft_scaled_font_unlock_face(m_scaledFont);
+    }
+
+    FT_Face ftFace() const { return m_ftFace; }
+
+private:
+    cairo_scaled_font_t* m_scaledFont { nullptr };
+    FT_Face m_ftFace { nullptr };
+};
+#endif
+
</ins><span class="cx"> void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr);
</span><span class="cx"> void setSourceRGBAFromColor(cairo_t*, const Color&amp;);
</span><span class="cx"> void appendPathToCairoContext(cairo_t* to, cairo_t* from);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -63,20 +63,12 @@
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;FcPattern&gt; findBestFontGivenFallbacks(const FontPlatformData&amp; fontData, FcPattern* pattern)
</span><span class="cx"> {
</span><del>-    if (!fontData.m_pattern)
</del><ins>+    FcFontSet* fallbacks = fontData.fallbacks();
+    if (!fallbacks)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (!fontData.m_fallbacks) {
-        FcResult fontConfigResult;
-        fontData.m_fallbacks = FcFontSort(nullptr, fontData.m_pattern.get(), FcTrue, nullptr, &amp;fontConfigResult);
-    }
-
-    if (!fontData.m_fallbacks)
-        return nullptr;
-
-    FcFontSet* sets[] = { fontData.m_fallbacks };
</del><span class="cx">     FcResult fontConfigResult;
</span><del>-    return FcFontSetMatch(nullptr, sets, 1, pattern, &amp;fontConfigResult);
</del><ins>+    return FcFontSetMatch(nullptr, &amp;fallbacks, 1, pattern, &amp;fontConfigResult);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;Font&gt; FontCache::systemFallbackForCharacters(const FontDescription&amp; description, const Font* originalFontData, bool, const UChar* characters, unsigned length)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDatah"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontPlatformData.h        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -1,128 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2007 Pioneer Research Center USA, Inc.
- * Copyright (C) 2010 Igalia S.L.
- * All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef FontPlatformDataFreeType_h
-#define FontPlatformDataFreeType_h
-
-#include &quot;FontCache.h&quot;
-#include &quot;FontDescription.h&quot;
-#include &quot;GlyphBuffer.h&quot;
-#include &quot;HarfBuzzFace.h&quot;
-#include &quot;OpenTypeVerticalData.h&quot;
-#include &quot;RefPtrCairo.h&quot;
-#include &quot;SharedBuffer.h&quot;
-#include &quot;TextFlags.h&quot;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/HashFunctions.h&gt;
-
-typedef struct _FcFontSet FcFontSet;
-class HarfBuzzFace;
-
-namespace WebCore {
-
-class FontPlatformData {
-public:
-    FontPlatformData(WTF::HashTableDeletedValueType)
-        : m_fallbacks(0)
-        , m_size(0)
-        , m_syntheticBold(false)
-        , m_syntheticOblique(false)
-        , m_scaledFont(hashTableDeletedFontValue())
-        , m_orientation(Horizontal)
-        { }
-
-    FontPlatformData()
-        : m_fallbacks(0)
-        , m_size(0)
-        , m_syntheticBold(false)
-        , m_syntheticOblique(false)
-        , m_scaledFont(0)
-        , m_orientation(Horizontal)
-        { }
-
-    FontPlatformData(FcPattern*, const FontDescription&amp;);
-    FontPlatformData(cairo_font_face_t*, const FontDescription&amp;, bool bold, bool italic);
-    FontPlatformData(float size, bool bold, bool italic);
-    FontPlatformData(const FontPlatformData&amp;);
-    FontPlatformData(const FontPlatformData&amp;, float size);
-
-    static FontPlatformData cloneWithOrientation(const FontPlatformData&amp;, FontOrientation);
-    static FontPlatformData cloneWithSyntheticOblique(const FontPlatformData&amp;, bool);
-    static FontPlatformData cloneWithSize(const FontPlatformData&amp;, float);
-
-    ~FontPlatformData();
-
-    HarfBuzzFace* harfBuzzFace() const;
-
-    bool isFixedPitch() const;
-    float size() const { return m_size; }
-    void setSize(float size) { m_size = size; }
-    bool syntheticBold() const { return m_syntheticBold; }
-    bool syntheticOblique() const { return m_syntheticOblique; }
-    void setSyntheticOblique(bool);
-    bool hasCompatibleCharmap();
-
-    FontOrientation orientation() const { return m_orientation; }
-    void setOrientation(FontOrientation);
-    PassRefPtr&lt;SharedBuffer&gt; openTypeTable(uint32_t table) const;
-    PassRefPtr&lt;OpenTypeVerticalData&gt; verticalData() const;
-
-    cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
-
-    unsigned hash() const
-    {
-        return PtrHash&lt;cairo_scaled_font_t*&gt;::hash(m_scaledFont);
-    }
-
-    bool operator==(const FontPlatformData&amp;) const;
-    FontPlatformData&amp; operator=(const FontPlatformData&amp;);
-    bool isHashTableDeletedValue() const
-    {
-        return m_scaledFont == hashTableDeletedFontValue();
-    }
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-
-    RefPtr&lt;FcPattern&gt; m_pattern;
-    mutable FcFontSet* m_fallbacks; // Initialized lazily.
-    float m_size;
-    bool m_syntheticBold;
-    bool m_syntheticOblique;
-    bool m_fixedWidth;
-    cairo_scaled_font_t* m_scaledFont;
-    mutable RefPtr&lt;HarfBuzzFace&gt; m_harfBuzzFace;
-
-private:
-    void buildScaledFont(cairo_font_face_t*);
-    static cairo_scaled_font_t* hashTableDeletedFontValue() { return reinterpret_cast&lt;cairo_scaled_font_t*&gt;(-1); }
-
-    FontOrientation m_orientation;
-};
-
-}
-
-#endif // FontPlatformDataFreeType_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -25,10 +25,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;FontPlatformData.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CairoUtilities.h&quot;
+#include &quot;FontCache.h&quot;
</ins><span class="cx"> #include &quot;FontDescription.h&quot;
</span><del>-#include &quot;RefPtrCairo.h&quot;
</del><ins>+#include &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #include &lt;cairo-ft.h&gt;
</span><del>-#include &lt;cairo.h&gt;
</del><span class="cx"> #include &lt;fontconfig/fcfreetype.h&gt;
</span><span class="cx"> #include &lt;ft2build.h&gt;
</span><span class="cx"> #include FT_TRUETYPE_TABLES_H
</span><span class="lines">@@ -136,12 +137,7 @@
</span><span class="cx"> 
</span><span class="cx"> FontPlatformData::FontPlatformData(FcPattern* pattern, const FontDescription&amp; fontDescription)
</span><span class="cx">     : m_pattern(pattern)
</span><del>-    , m_fallbacks(nullptr)
</del><span class="cx">     , m_size(fontDescription.computedPixelSize())
</span><del>-    , m_syntheticBold(false)
-    , m_syntheticOblique(false)
-    , m_fixedWidth(false)
-    , m_scaledFont(nullptr)
</del><span class="cx">     , m_orientation(fontDescription.orientation())
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_pattern);
</span><span class="lines">@@ -175,36 +171,24 @@
</span><span class="cx">     buildScaledFont(fontFace.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FontPlatformData::FontPlatformData(float size, bool bold, bool italic)
-    : m_fallbacks(nullptr)
-    , m_size(size)
-    , m_syntheticBold(bold)
-    , m_syntheticOblique(italic)
-    , m_fixedWidth(false)
-    , m_scaledFont(nullptr)
-    , m_orientation(Horizontal)
-{
-    // We cannot create a scaled font here.
-}
-
</del><span class="cx"> FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, const FontDescription&amp; description, bool bold, bool italic)
</span><del>-    : m_fallbacks(nullptr)
-    , m_size(description.computedPixelSize())
</del><ins>+    : m_size(description.computedPixelSize())
+    , m_orientation(description.orientation())
</ins><span class="cx">     , m_syntheticBold(bold)
</span><span class="cx">     , m_syntheticOblique(italic)
</span><del>-    , m_fixedWidth(false)
-    , m_scaledFont(nullptr)
-    , m_orientation(description.orientation())
</del><span class="cx"> {
</span><span class="cx">     buildScaledFont(fontFace);
</span><span class="cx"> 
</span><del>-    FT_Face fontConfigFace = cairo_ft_scaled_font_lock_face(m_scaledFont);
-    if (fontConfigFace) {
</del><ins>+    CairoFtFaceLocker cairoFtFaceLocker(m_scaledFont.get());
+    if (FT_Face fontConfigFace = cairoFtFaceLocker.ftFace())
</ins><span class="cx">         m_fixedWidth = fontConfigFace-&gt;face_flags &amp; FT_FACE_FLAG_FIXED_WIDTH;
</span><del>-        cairo_ft_scaled_font_unlock_face(m_scaledFont);
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FontPlatformData::FontPlatformData(const FontPlatformData&amp; other)
+{
+    *this = other;
+}
+
</ins><span class="cx"> FontPlatformData&amp; FontPlatformData::operator=(const FontPlatformData&amp; other)
</span><span class="cx"> {
</span><span class="cx">     // Check for self-assignment.
</span><span class="lines">@@ -212,70 +196,50 @@
</span><span class="cx">         return *this;
</span><span class="cx"> 
</span><span class="cx">     m_size = other.m_size;
</span><ins>+    m_orientation = other.m_orientation;
+    m_widthVariant = other.m_widthVariant;
+    m_textRenderingMode = other.m_textRenderingMode;
+
</ins><span class="cx">     m_syntheticBold = other.m_syntheticBold;
</span><span class="cx">     m_syntheticOblique = other.m_syntheticOblique;
</span><ins>+    m_isColorBitmapFont = other.m_isColorBitmapFont;
+    m_isHashTableDeletedValue = other.m_isHashTableDeletedValue;
+    m_isSystemFont = other.m_isSystemFont;
+
</ins><span class="cx">     m_fixedWidth = other.m_fixedWidth;
</span><span class="cx">     m_pattern = other.m_pattern;
</span><del>-    m_orientation = other.m_orientation;
</del><span class="cx"> 
</span><del>-    if (m_fallbacks) {
-        FcFontSetDestroy(m_fallbacks);
-        // This will be re-created on demand.
-        m_fallbacks = nullptr;
-    }
</del><ins>+    // This will be re-created on demand.
+    m_fallbacks = nullptr;
</ins><span class="cx"> 
</span><del>-    if (m_scaledFont &amp;&amp; m_scaledFont != hashTableDeletedFontValue())
-        cairo_scaled_font_destroy(m_scaledFont);
-    m_scaledFont = cairo_scaled_font_reference(other.m_scaledFont);
-
</del><ins>+    m_scaledFont = other.m_scaledFont;
</ins><span class="cx">     m_harfBuzzFace = other.m_harfBuzzFace;
</span><span class="cx"> 
</span><span class="cx">     return *this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FontPlatformData::FontPlatformData(const FontPlatformData&amp; other)
-    : m_fallbacks(nullptr)
-    , m_scaledFont(nullptr)
-    , m_harfBuzzFace(other.m_harfBuzzFace)
-{
-    *this = other;
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData&amp; other, float size)
-    : m_fallbacks(nullptr)
-    , m_scaledFont(nullptr)
-    , m_harfBuzzFace(other.m_harfBuzzFace)
-{
-    *this = other;
-
-    // We need to reinitialize the instance, because the difference in size 
-    // necessitates a new scaled font instance.
-    m_size = size;
-    buildScaledFont(cairo_scaled_font_get_font_face(m_scaledFont));
-}
-
</del><span class="cx"> FontPlatformData::~FontPlatformData()
</span><span class="cx"> {
</span><del>-    if (m_fallbacks) {
-        FcFontSetDestroy(m_fallbacks);
-        m_fallbacks = nullptr;
-    }
-
-    if (m_scaledFont &amp;&amp; m_scaledFont != hashTableDeletedFontValue())
-        cairo_scaled_font_destroy(m_scaledFont);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontPlatformData FontPlatformData::cloneWithOrientation(const FontPlatformData&amp; source, FontOrientation orientation)
</span><span class="cx"> {
</span><span class="cx">     FontPlatformData copy(source);
</span><del>-    copy.m_orientation = orientation;
</del><ins>+    if (copy.m_scaledFont &amp;&amp; copy.m_orientation != orientation) {
+        copy.m_orientation = orientation;
+        copy.buildScaledFont(cairo_scaled_font_get_font_face(copy.m_scaledFont.get()));
+    }
</ins><span class="cx">     return copy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontPlatformData FontPlatformData::cloneWithSyntheticOblique(const FontPlatformData&amp; source, bool syntheticOblique)
</span><span class="cx"> {
</span><span class="cx">     FontPlatformData copy(source);
</span><del>-    copy.m_syntheticOblique = syntheticOblique;
</del><ins>+    if (copy.m_syntheticOblique != syntheticOblique) {
+        copy.m_syntheticOblique = syntheticOblique;
+        ASSERT(copy.m_scaledFont.get());
+        copy.buildScaledFont(cairo_scaled_font_get_font_face(copy.m_scaledFont.get()));
+    }
</ins><span class="cx">     return copy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -283,6 +247,10 @@
</span><span class="cx"> {
</span><span class="cx">     FontPlatformData copy(source);
</span><span class="cx">     copy.m_size = size;
</span><ins>+    // We need to reinitialize the instance, because the difference in size
+    // necessitates a new scaled font instance.
+    ASSERT(copy.m_scaledFont.get());
+    copy.buildScaledFont(cairo_scaled_font_get_font_face(copy.m_scaledFont.get()));
</ins><span class="cx">     return copy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -294,12 +262,24 @@
</span><span class="cx">     return m_harfBuzzFace.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FcFontSet* FontPlatformData::fallbacks() const
+{
+    if (m_fallbacks)
+        return m_fallbacks.get();
+
+    if (m_pattern) {
+        FcResult fontConfigResult;
+        m_fallbacks.reset(FcFontSort(nullptr, m_pattern.get(), FcTrue, nullptr, &amp;fontConfigResult));
+    }
+    return m_fallbacks.get();
+}
+
</ins><span class="cx"> bool FontPlatformData::isFixedPitch() const
</span><span class="cx"> {
</span><span class="cx">     return m_fixedWidth;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FontPlatformData::operator==(const FontPlatformData&amp; other) const
</del><ins>+bool FontPlatformData::platformIsEqual(const FontPlatformData&amp; other) const
</ins><span class="cx"> {
</span><span class="cx">     // FcPatternEqual does not support null pointers as arguments.
</span><span class="cx">     if ((m_pattern &amp;&amp; !other.m_pattern)
</span><span class="lines">@@ -307,11 +287,7 @@
</span><span class="cx">         || (m_pattern != other.m_pattern &amp;&amp; !FcPatternEqual(m_pattern.get(), other.m_pattern.get())))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return m_scaledFont == other.m_scaledFont
-        &amp;&amp; m_size == other.m_size
-        &amp;&amp; m_syntheticOblique == other.m_syntheticOblique
-        &amp;&amp; m_orientation == other.m_orientation
-        &amp;&amp; m_syntheticBold == other.m_syntheticBold; 
</del><ins>+    return m_scaledFont == other.m_scaledFont;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -364,22 +340,20 @@
</span><span class="cx">         cairo_matrix_translate(&amp;fontMatrix, 0.0, 1.0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_scaledFont &amp;&amp; m_scaledFont != hashTableDeletedFontValue())
-        cairo_scaled_font_destroy(m_scaledFont);
-
-    m_scaledFont = cairo_scaled_font_create(fontFace, &amp;fontMatrix, &amp;ctm, options);
</del><ins>+    m_scaledFont = adoptRef(cairo_scaled_font_create(fontFace, &amp;fontMatrix, &amp;ctm, options));
</ins><span class="cx">     cairo_font_options_destroy(options);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FontPlatformData::hasCompatibleCharmap()
</del><ins>+bool FontPlatformData::hasCompatibleCharmap() const
</ins><span class="cx"> {
</span><del>-    ASSERT(m_scaledFont);
-    FT_Face freeTypeFace = cairo_ft_scaled_font_lock_face(m_scaledFont);
-    bool hasCompatibleCharmap = !(FT_Select_Charmap(freeTypeFace, ft_encoding_unicode)
-                                &amp;&amp; FT_Select_Charmap(freeTypeFace, ft_encoding_symbol)
-                                &amp;&amp; FT_Select_Charmap(freeTypeFace, ft_encoding_apple_roman));
-    cairo_ft_scaled_font_unlock_face(m_scaledFont);
-    return hasCompatibleCharmap;
</del><ins>+    ASSERT(m_scaledFont.get());
+    CairoFtFaceLocker cairoFtFaceLocker(m_scaledFont.get());
+    FT_Face freeTypeFace = cairoFtFaceLocker.ftFace();
+    if (!freeTypeFace)
+        return false;
+    return !(FT_Select_Charmap(freeTypeFace, ft_encoding_unicode)
+        &amp;&amp; FT_Select_Charmap(freeTypeFace, ft_encoding_symbol)
+        &amp;&amp; FT_Select_Charmap(freeTypeFace, ft_encoding_apple_roman));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;OpenTypeVerticalData&gt; FontPlatformData::verticalData() const
</span><span class="lines">@@ -388,9 +362,10 @@
</span><span class="cx">     return FontCache::singleton().getVerticalData(String::number(hash()), *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;SharedBuffer&gt; FontPlatformData::openTypeTable(uint32_t table) const
</del><ins>+RefPtr&lt;SharedBuffer&gt; FontPlatformData::openTypeTable(uint32_t table) const
</ins><span class="cx"> {
</span><del>-    FT_Face freeTypeFace = cairo_ft_scaled_font_lock_face(m_scaledFont);
</del><ins>+    CairoFtFaceLocker cairoFtFaceLocker(m_scaledFont.get());
+    FT_Face freeTypeFace = cairoFtFaceLocker.ftFace();
</ins><span class="cx">     if (!freeTypeFace)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -401,37 +376,15 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; buffer = SharedBuffer::create(tableSize);
</span><del>-    FT_ULong expectedTableSize = tableSize;
</del><span class="cx">     if (buffer-&gt;size() != tableSize)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><ins>+    FT_ULong expectedTableSize = tableSize;
</ins><span class="cx">     FT_Error error = FT_Load_Sfnt_Table(freeTypeFace, tag, 0, reinterpret_cast&lt;FT_Byte*&gt;(const_cast&lt;char*&gt;(buffer-&gt;data())), &amp;tableSize);
</span><span class="cx">     if (error || tableSize != expectedTableSize)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    cairo_ft_scaled_font_unlock_face(m_scaledFont);
-
-    return buffer.release();
</del><ins>+    return buffer;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FontPlatformData::setOrientation(FontOrientation orientation)
-{
-    if (!m_scaledFont || (m_orientation == orientation))
-        return;
-
-    ASSERT(m_scaledFont);
-    m_orientation = orientation;
-    buildScaledFont(cairo_scaled_font_get_font_face(m_scaledFont));
-}
-
-void FontPlatformData::setSyntheticOblique(bool newSyntheticObliqueValue)
-{
-    if (newSyntheticObliqueValue == syntheticOblique())
-        return;
-
-    ASSERT(m_scaledFont);
-    m_syntheticOblique = newSyntheticObliqueValue;
-    buildScaledFont(cairo_scaled_font_get_font_face(m_scaledFont));
-}
-
-}
</del><ins>+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeGlyphPageTreeNodeFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;GlyphPage.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CairoUtilities.h&quot;
</ins><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;UTF16UChar32Iterator.h&quot;
</span><span class="cx"> #include &lt;cairo-ft.h&gt;
</span><span class="lines">@@ -45,7 +46,8 @@
</span><span class="cx">     cairo_scaled_font_t* scaledFont = font.platformData().scaledFont();
</span><span class="cx">     ASSERT(scaledFont);
</span><span class="cx"> 
</span><del>-    FT_Face face = cairo_ft_scaled_font_lock_face(scaledFont);
</del><ins>+    CairoFtFaceLocker cairoFtFaceLocker(scaledFont);
+    FT_Face face = cairoFtFaceLocker.ftFace();
</ins><span class="cx">     if (!face)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -65,7 +67,6 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    cairo_ft_scaled_font_unlock_face(scaledFont);
</del><span class="cx">     return haveGlyphs;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeSimpleFontDataFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CairoUtilities.h&quot;
</ins><span class="cx"> #include &quot;FloatConversion.h&quot;
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="lines">@@ -53,7 +54,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Font::platformInit()
</span><span class="cx"> {
</span><del>-    if (!m_platformData.m_size)
</del><ins>+    if (!m_platformData.size())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_platformData.scaledFont());
</span><span class="lines">@@ -65,20 +66,24 @@
</span><span class="cx">     float capHeight = narrowPrecisionToFloat(fontExtents.height);
</span><span class="cx">     float lineGap = narrowPrecisionToFloat(fontExtents.height - fontExtents.ascent - fontExtents.descent);
</span><span class="cx"> 
</span><del>-    // If the USE_TYPO_METRICS flag is set in the OS/2 table then we use typo metrics instead.
-    FT_Face freeTypeFace = cairo_ft_scaled_font_lock_face(m_platformData.scaledFont());
-    if (TT_OS2* OS2Table = static_cast&lt;TT_OS2*&gt;(FT_Get_Sfnt_Table(freeTypeFace, ft_sfnt_os2))) {
-        const FT_Short kUseTypoMetricsMask = 1 &lt;&lt; 7;
-        if (OS2Table-&gt;fsSelection &amp; kUseTypoMetricsMask) {
-            // FT_Size_Metrics::y_scale is in 16.16 fixed point format.
-            // Its (fractional) value is a factor that converts vertical metrics from design units to units of 1/64 pixels.
-            double yscale = (freeTypeFace-&gt;size-&gt;metrics.y_scale / 65536.0) / 64.0;
-            ascent = narrowPrecisionToFloat(yscale * OS2Table-&gt;sTypoAscender);
-            descent = -narrowPrecisionToFloat(yscale * OS2Table-&gt;sTypoDescender);
-            lineGap = narrowPrecisionToFloat(yscale * OS2Table-&gt;sTypoLineGap);
</del><ins>+    {
+        CairoFtFaceLocker cairoFtFaceLocker(m_platformData.scaledFont());
+
+        // If the USE_TYPO_METRICS flag is set in the OS/2 table then we use typo metrics instead.
+        FT_Face freeTypeFace = cairoFtFaceLocker.ftFace();
+        TT_OS2* OS2Table = freeTypeFace ? static_cast&lt;TT_OS2*&gt;(FT_Get_Sfnt_Table(freeTypeFace, ft_sfnt_os2)) : nullptr;
+        if (OS2Table) {
+            const FT_Short kUseTypoMetricsMask = 1 &lt;&lt; 7;
+            if (OS2Table-&gt;fsSelection &amp; kUseTypoMetricsMask) {
+                // FT_Size_Metrics::y_scale is in 16.16 fixed point format.
+                // Its (fractional) value is a factor that converts vertical metrics from design units to units of 1/64 pixels.
+                double yscale = (freeTypeFace-&gt;size-&gt;metrics.y_scale / 65536.0) / 64.0;
+                ascent = narrowPrecisionToFloat(yscale * OS2Table-&gt;sTypoAscender);
+                descent = -narrowPrecisionToFloat(yscale * OS2Table-&gt;sTypoDescender);
+                lineGap = narrowPrecisionToFloat(yscale * OS2Table-&gt;sTypoLineGap);
+            }
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    cairo_ft_scaled_font_unlock_face(m_platformData.scaledFont());
</del><span class="cx"> 
</span><span class="cx">     m_fontMetrics.setAscent(ascent);
</span><span class="cx">     m_fontMetrics.setDescent(descent);
</span><span class="lines">@@ -100,9 +105,9 @@
</span><span class="cx">     m_spaceWidth = narrowPrecisionToFloat((platformData().orientation() == Horizontal) ? textExtents.x_advance : -textExtents.y_advance);
</span><span class="cx"> 
</span><span class="cx">     if ((platformData().orientation() == Vertical) &amp;&amp; !isTextOrientationFallback()) {
</span><del>-        FT_Face freeTypeFace = cairo_ft_scaled_font_lock_face(m_platformData.scaledFont());
</del><ins>+        CairoFtFaceLocker cairoFtFaceLocker(m_platformData.scaledFont());
+        FT_Face freeTypeFace = cairoFtFaceLocker.ftFace();
</ins><span class="cx">         m_fontMetrics.setUnitsPerEm(freeTypeFace-&gt;units_per_EM);
</span><del>-        cairo_ft_scaled_font_unlock_face(m_platformData.scaledFont());
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_syntheticBoldOffset = m_platformData.syntheticBold() ? 1.0f : 0.f;
</span><span class="lines">@@ -179,14 +184,14 @@
</span><span class="cx">     if (U_FAILURE(error) || (static_cast&lt;size_t&gt;(normalizedLength) == length))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    FT_Face face = cairo_ft_scaled_font_lock_face(m_platformData.scaledFont());
</del><ins>+    CairoFtFaceLocker cairoFtFaceLocker(m_platformData.scaledFont());
+    FT_Face face = cairoFtFaceLocker.ftFace();
</ins><span class="cx">     if (!face)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (FcFreeTypeCharIndex(face, normalizedCharacters[0]))
</span><span class="cx">         addResult.iterator-&gt;value = true;
</span><span class="cx"> 
</span><del>-    cairo_ft_scaled_font_unlock_face(m_platformData.scaledFont());
</del><span class="cx">     return addResult.iterator-&gt;value;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsharfbuzzHarfBuzzFaceCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;HarfBuzzFace.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CairoUtilities.h&quot;
</ins><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;FontPlatformData.h&quot;
</span><span class="cx"> #include &quot;GlyphBuffer.h&quot;
</span><span class="lines">@@ -57,21 +58,6 @@
</span><span class="cx">     cairo_scaled_font_t* m_cairoScaledFont;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class CairoFtFaceLocker {
-public:
-    CairoFtFaceLocker(cairo_scaled_font_t* cairoScaledFont) : m_scaledFont(cairoScaledFont) { };
-    FT_Face lock()
-    {
-        return cairo_ft_scaled_font_lock_face(m_scaledFont);
-    };
-    ~CairoFtFaceLocker()
-    {
-        cairo_ft_scaled_font_unlock_face(m_scaledFont);
-    }
-private:
-    cairo_scaled_font_t* m_scaledFont;
-};
-
</del><span class="cx"> static hb_position_t floatToHarfBuzzPosition(float value)
</span><span class="cx"> {
</span><span class="cx">     return static_cast&lt;hb_position_t&gt;(value * (1 &lt;&lt; 16));
</span><span class="lines">@@ -178,9 +164,9 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     CairoFtFaceLocker cairoFtFaceLocker(scaledFont);
</span><del>-    FT_Face ftFont = cairoFtFaceLocker.lock();
</del><ins>+    FT_Face ftFont = cairoFtFaceLocker.ftFace();
</ins><span class="cx">     if (!ftFont)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     FT_ULong tableSize = 0;
</span><span class="cx">     FT_Error error = FT_Load_Sfnt_Table(ftFont, tag, 0, 0, &amp;tableSize);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-04-27  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
+        https://bugs.webkit.org/show_bug.cgi?id=157066
+
+        Reviewed by Martin Robinson.
+
+        Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
+        includes FcUniquePtr.h.
+
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+
</ins><span class="cx"> 2016-04-26  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformEfl.cmake (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformEfl.cmake        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebKit2/PlatformEfl.cmake        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -236,6 +236,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/efl&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cairo&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/efl&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/platform/graphics/freetype&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opentype&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/x11&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/network/soup&quot;
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (200128 => 200129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2016-04-27 15:58:44 UTC (rev 200128)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2016-04-27 16:47:13 UTC (rev 200129)
</span><span class="lines">@@ -495,6 +495,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/cairo&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/gtk&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cairo&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/platform/graphics/freetype&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opentype&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/x11&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/network/soup&quot;
</span></span></pre>
</div>
</div>

</body>
</html>