<!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>[215035] releases/WebKitGTK/webkit-2.14/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/215035">215035</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-04-06 06:02:22 -0700 (Thu, 06 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/214283">r214283</a> - [GTK] Honor GTK+ font settings
https://bugs.webkit.org/show_bug.cgi?id=82889

Reviewed by Carlos Garcia Campos.

After much discussion with Behdad and Martin (who is still not completely convinced I think
:) I want to merge cairo font options into the Fontconfig pattern used for rendering using
cairo_ft_font_options_substitute(). This is how the API was designed to be used anyway.
Fontconfig will still have final say over whether to actually respect the desktop settings
or not, so it can still choose to ignore the desktop's settings, but I don't think it makes
sense to have desktop-wide font settings and not tell Fontconfig about them, especially when
the whole point of WebKitGTK+ is desktop integration. This should also reduce complaints
that we're not following desktop settings and that we're drawing fonts differently than
Firefox.

* PlatformGTK.cmake:
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::getDefaultCairoFontOptions):
* platform/graphics/cairo/CairoUtilities.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::createFontConfigPatternForCharacters):
(WebCore::strongAliasesForFamily):
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::getDefaultFontconfigOptions):
(WebCore::getDefaultCairoFontOptions): Deleted.
* platform/graphics/gtk/GdkCairoUtilities.cpp:
(getDefaultCairoFontOptions):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorePlatformGTKcmake">releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicscairoCairoUtilitiescpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicscairoCairoUtilitiesh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsgtkGdkCairoUtilitiescpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsgtkGdkCairoUtilitiesh">releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2017-03-22  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
+
+        [GTK] Honor GTK+ font settings
+        https://bugs.webkit.org/show_bug.cgi?id=82889
+
+        Reviewed by Carlos Garcia Campos.
+
+        After much discussion with Behdad and Martin (who is still not completely convinced I think
+        :) I want to merge cairo font options into the Fontconfig pattern used for rendering using
+        cairo_ft_font_options_substitute(). This is how the API was designed to be used anyway.
+        Fontconfig will still have final say over whether to actually respect the desktop settings
+        or not, so it can still choose to ignore the desktop's settings, but I don't think it makes
+        sense to have desktop-wide font settings and not tell Fontconfig about them, especially when
+        the whole point of WebKitGTK+ is desktop integration. This should also reduce complaints
+        that we're not following desktop settings and that we're drawing fonts differently than
+        Firefox.
+
+        * PlatformGTK.cmake:
+        * platform/graphics/cairo/CairoUtilities.cpp:
+        (WebCore::getDefaultCairoFontOptions):
+        * platform/graphics/cairo/CairoUtilities.h:
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::createFontConfigPatternForCharacters):
+        (WebCore::strongAliasesForFamily):
+        (WebCore::FontCache::createFontPlatformData):
+        * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
+        (WebCore::getDefaultFontconfigOptions):
+        (WebCore::getDefaultCairoFontOptions): Deleted.
+        * platform/graphics/gtk/GdkCairoUtilities.cpp:
+        (getDefaultCairoFontOptions):
+
</ins><span class="cx"> 2017-03-21  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Soup] &quot;Only from websites I visit&quot; cookie policy is broken
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/PlatformGTK.cmake        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/freetype/FontCacheFreeType.cpp
</span><span class="cx">     platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
</span><ins>+    platform/graphics/freetype/FontPlatformDataFreeType.cpp
</ins><span class="cx">     platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
</span><span class="cx">     platform/graphics/freetype/SimpleFontDataFreeType.cpp
</span><span class="cx"> 
</span><span class="lines">@@ -207,8 +208,6 @@
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/PlatformDisplay.cpp
</span><span class="cx"> 
</span><del>-    platform/graphics/freetype/FontPlatformDataFreeType.cpp
-
</del><span class="cx">     platform/graphics/gtk/ColorGtk.cpp
</span><span class="cx">     platform/graphics/gtk/GdkCairoUtilities.cpp
</span><span class="cx">     platform/graphics/gtk/IconGtk.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicscairoCairoUtilitiescpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &quot;RefPtrCairo.h&quot;
</span><span class="cx"> #include &quot;Region.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ACCELERATED_2D_CANVAS)
</span><span class="lines">@@ -47,6 +48,14 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if USE(FREETYPE) &amp;&amp; !PLATFORM(GTK)
+const cairo_font_options_t* getDefaultCairoFontOptions()
+{
+    static NeverDestroyed&lt;cairo_font_options_t*&gt; options = cairo_font_options_create();
+    return options;
+}
+#endif
+
</ins><span class="cx"> void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr)
</span><span class="cx"> {
</span><span class="cx">     cairo_set_antialias(dstCr, cairo_get_antialias(srcCr));
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicscairoCairoUtilitiesh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.h (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.h        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/cairo/CairoUtilities.h        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -24,8 +24,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef CairoUtilities_h
-#define CairoUtilities_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CAIRO)
</span><span class="cx"> 
</span><span class="lines">@@ -71,6 +70,8 @@
</span><span class="cx">     cairo_scaled_font_t* m_scaledFont { nullptr };
</span><span class="cx">     FT_Face m_ftFace { nullptr };
</span><span class="cx"> };
</span><ins>+
+const cairo_font_options_t* getDefaultCairoFontOptions();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr);
</span><span class="lines">@@ -97,5 +98,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(CAIRO)
</span><del>-
-#endif // CairoUtilities_h
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CairoUtilities.h&quot;
</ins><span class="cx"> #include &quot;FcUniquePtr.h&quot;
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;RefPtrCairo.h&quot;
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> 
</span><span class="cx">     FcPatternAddBool(pattern.get(), FC_SCALABLE, FcTrue);
</span><span class="cx">     FcConfigSubstitute(nullptr, pattern.get(), FcMatchPattern);
</span><ins>+    cairo_ft_font_options_substitute(getDefaultCairoFontOptions(), pattern.get());
</ins><span class="cx">     FcDefaultSubstitute(pattern.get());
</span><span class="cx">     return pattern;
</span><span class="cx"> }
</span><span class="lines">@@ -261,6 +263,7 @@
</span><span class="cx">         return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">     FcConfigSubstitute(nullptr, pattern.get(), FcMatchPattern);
</span><ins>+    cairo_ft_font_options_substitute(getDefaultCairoFontOptions(), pattern.get());
</ins><span class="cx">     FcDefaultSubstitute(pattern.get());
</span><span class="cx"> 
</span><span class="cx">     FcUniquePtr&lt;FcObjectSet&gt; familiesOnly(FcObjectSetBuild(FC_FAMILY, nullptr));
</span><span class="lines">@@ -355,6 +358,7 @@
</span><span class="cx">     // configuration step, before any matching occurs, we allow arbitrary family substitutions,
</span><span class="cx">     // since this is an exact matter of respecting the user's font configuration.
</span><span class="cx">     FcConfigSubstitute(nullptr, pattern.get(), FcMatchPattern);
</span><ins>+    cairo_ft_font_options_substitute(getDefaultCairoFontOptions(), pattern.get());
</ins><span class="cx">     FcDefaultSubstitute(pattern.get());
</span><span class="cx"> 
</span><span class="cx">     FcChar8* fontConfigFamilyNameAfterConfiguration;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsfreetypeFontPlatformDataFreeTypecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -37,10 +37,6 @@
</span><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(GTK)
-#include &lt;gdk/gdk.h&gt;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static cairo_subpixel_order_t convertFontConfigSubpixelOrder(int fontConfigOrder)
</span><span class="lines">@@ -106,18 +102,6 @@
</span><span class="cx">         cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static CairoUniquePtr&lt;cairo_font_options_t&gt; getDefaultCairoFontOptions()
-{
-#if PLATFORM(GTK)
-    if (GdkScreen* screen = gdk_screen_get_default()) {
-        const cairo_font_options_t* screenOptions = gdk_screen_get_font_options(screen);
-        if (screenOptions)
-            return CairoUniquePtr&lt;cairo_font_options_t&gt;(cairo_font_options_copy(screenOptions));
-    }
-#endif
-    return CairoUniquePtr&lt;cairo_font_options_t&gt;(cairo_font_options_create());
-}
-
</del><span class="cx"> static FcPattern* getDefaultFontconfigOptions()
</span><span class="cx"> {
</span><span class="cx">     // Get some generic default settings from fontconfig for web fonts. Strategy
</span><span class="lines">@@ -129,6 +113,7 @@
</span><span class="cx">     std::call_once(flag, [](FcPattern*) {
</span><span class="cx">         pattern = FcPatternCreate();
</span><span class="cx">         FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
</span><ins>+        cairo_ft_font_options_substitute(getDefaultCairoFontOptions(), pattern);
</ins><span class="cx">         FcDefaultSubstitute(pattern);
</span><span class="cx">         FcPatternDel(pattern, FC_FAMILY);
</span><span class="cx">         FcConfigSubstitute(nullptr, pattern, FcMatchFont);
</span><span class="lines">@@ -300,7 +285,7 @@
</span><span class="cx"> 
</span><span class="cx"> void FontPlatformData::buildScaledFont(cairo_font_face_t* fontFace)
</span><span class="cx"> {
</span><del>-    CairoUniquePtr&lt;cairo_font_options_t&gt; options = getDefaultCairoFontOptions();
</del><ins>+    CairoUniquePtr&lt;cairo_font_options_t&gt; options(cairo_font_options_copy(getDefaultCairoFontOptions()));
</ins><span class="cx">     FcPattern* optionsPattern = m_pattern ? m_pattern.get() : getDefaultFontconfigOptions();
</span><span class="cx">     setCairoFontOptionsFromFontConfigPattern(options.get(), optionsPattern);
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsgtkGdkCairoUtilitiescpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -31,9 +31,26 @@
</span><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &lt;cairo.h&gt;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><ins>+#include &lt;mutex&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> 
</span><del>-using namespace WebCore;
</del><ins>+namespace WebCore {
</ins><span class="cx"> 
</span><ins>+const cairo_font_options_t* getDefaultCairoFontOptions()
+{
+    if (auto* screen = gdk_screen_get_default()) {
+        if (auto* options = gdk_screen_get_font_options(screen))
+            return options;
+    }
+
+    static LazyNeverDestroyed&lt;cairo_font_options_t*&gt; options;
+    static std::once_flag flag;
+    std::call_once(flag, [] {
+        options.construct(cairo_font_options_create());
+    });
+    return options;
+}
+
</ins><span class="cx"> GdkPixbuf* cairoSurfaceToGdkPixbuf(cairo_surface_t* surface)
</span><span class="cx"> {
</span><span class="cx">     IntSize size = cairoSurfaceSize(surface);
</span><span class="lines">@@ -40,3 +57,4 @@
</span><span class="cx">     return gdk_pixbuf_get_from_surface(surface, 0, 0, size.width(), size.height());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreplatformgraphicsgtkGdkCairoUtilitiesh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.h (215034 => 215035)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.h        2017-04-06 12:56:57 UTC (rev 215034)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.h        2017-04-06 13:02:22 UTC (rev 215035)
</span><span class="lines">@@ -23,9 +23,10 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef GdkCairoUtilities_h
-#define GdkCairoUtilities_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><ins>+namespace WebCore {
+
</ins><span class="cx"> GdkPixbuf* cairoSurfaceToGdkPixbuf(cairo_surface_t*);
</span><span class="cx"> 
</span><del>-#endif // GdkCairoUtilities_h
</del><ins>+}
</ins></span></pre>
</div>
</div>

</body>
</html>