<!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>[197981] trunk</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/197981">197981</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2016-03-10 17:49:22 -0800 (Thu, 10 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Font antialiasing (smoothing) changes when elements are rendered into compositing layers
https://bugs.webkit.org/show_bug.cgi?id=23364
Reviewed by Tim Horton.
Source/WebCore:
Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
by opting in to a new CALayer backing store format.
GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
when the platform has support for the new feature. Ideally this would only be set when
we know a layer has smoothed text drawn into it, but, for now, enable this for all
layers. The right thing happens with opaque layers under the hood.
setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
is ultimately passed to setBackingStoreFormat().
We also need to propagate this flag to TileController tiles.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsSmoothedLayerText):
(WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
(WebCore::GraphicsLayer::smoothedLayerTextEnabled):
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::supportsSmoothedFonts):
(WebCore::GraphicsLayer::setSupportsSmoothedFonts):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::supportsSmoothedLayerText):
(WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
(WebCore::GraphicsLayer::smoothedLayerTextEnabled):
(WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateContentsFormat):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
the contents format says we support smoothed fonts.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setTileContentsFormatFlags):
(WebCore::TileController::createTileLayer):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::updateTileLayerProperties):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::setBackingStoreFormat):
(PlatformCALayerCocoa::commonInit):
(PlatformCALayerCocoa::setContentsFormat):
(PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
non-opaque layers to improve text appearance. We no longer need to do that when
the contents format has "SmoothedFonts".
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::setContentsFormat):
(PlatformCALayerWin::contentsFormat):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/ios/LegacyTileGridTile.mm:
(WebCore::setBackingStoreFormat):
(WebCore::LegacyTileGridTile::LegacyTileGridTile):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
Source/WebKit/mac:
Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
can disable it.
* WebView/WebView.mm:
(+[WebView _setSmoothedLayerTextEnabled:]):
(+[WebView _smoothedLayerTextEnabled]):
* WebView/WebViewPrivate.h:
Source/WebKit2:
Send the ContentsFormat to the UI process (but nothing happens to it there yet).
Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
can disable it.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* UIProcess/API/C/WKContext.cpp:
(WKContextEnableSmoothedLayerText):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::enableSmoothedLayerText):
(WebKit::WebProcessPool::WebProcessPool): Deleted.
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setContentsFormat):
(WebKit::PlatformCALayerRemote::contentsFormat):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::enableSmoothedLayerText):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
Tools:
Turn off smoothed layer text because it affects many layout test results.
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayercpp">trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerh">trunk/Source/WebCore/platform/graphics/GraphicsLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsTiledBackingh">trunk/Source/WebCore/platform/graphics/TiledBacking.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayercpp">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileControllercpp">trunk/Source/WebCore/platform/graphics/ca/TileController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileControllerh">trunk/Source/WebCore/platform/graphics/ca/TileController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileGridcpp">trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoah">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosLegacyTileGridTilemm">trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewPrivateh">trunk/Source/WebKit/mac/WebView/WebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParameterscpp">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParametersh">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKContextcpp">trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKContextPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/ChangeLog        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2016-03-10 Simon Fraser <simon.fraser@apple.com>
+
+ Font antialiasing (smoothing) changes when elements are rendered into compositing layers
+ https://bugs.webkit.org/show_bug.cgi?id=23364
+
+ Reviewed by Tim Horton.
+
+ Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
+ by opting in to a new CALayer backing store format.
+
+ GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
+ when the platform has support for the new feature. Ideally this would only be set when
+ we know a layer has smoothed text drawn into it, but, for now, enable this for all
+ layers. The right thing happens with opaque layers under the hood.
+
+ setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
+ is ultimately passed to setBackingStoreFormat().
+
+ We also need to propagate this flag to TileController tiles.
+
+ * platform/graphics/GraphicsLayer.cpp:
+ (WebCore::GraphicsLayer::supportsSmoothedLayerText):
+ (WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
+ (WebCore::GraphicsLayer::smoothedLayerTextEnabled):
+ (WebCore::GraphicsLayer::GraphicsLayer):
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::supportsSmoothedFonts):
+ (WebCore::GraphicsLayer::setSupportsSmoothedFonts):
+ * platform/graphics/TiledBacking.h:
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayer::supportsSmoothedLayerText):
+ (WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
+ (WebCore::GraphicsLayer::smoothedLayerTextEnabled):
+ (WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+ (WebCore::GraphicsLayerCA::updateContentsFormat):
+ * platform/graphics/ca/GraphicsLayerCA.h:
+ * platform/graphics/ca/PlatformCALayer.cpp:
+ (WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
+ the contents format says we support smoothed fonts.
+ * platform/graphics/ca/PlatformCALayer.h:
+ * platform/graphics/ca/TileController.cpp:
+ (WebCore::TileController::setTileContentsFormatFlags):
+ (WebCore::TileController::createTileLayer):
+ * platform/graphics/ca/TileController.h:
+ * platform/graphics/ca/TileGrid.cpp:
+ (WebCore::TileGrid::updateTileLayerProperties):
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+ (WebCore::setBackingStoreFormat):
+ (PlatformCALayerCocoa::commonInit):
+ (PlatformCALayerCocoa::setContentsFormat):
+ (PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
+ non-opaque layers to improve text appearance. We no longer need to do that when
+ the contents format has "SmoothedFonts".
+ * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+ (PlatformCALayerWin::setContentsFormat):
+ (PlatformCALayerWin::contentsFormat):
+ * platform/graphics/ca/win/PlatformCALayerWin.h:
+ * platform/ios/LegacyTileGridTile.mm:
+ (WebCore::setBackingStoreFormat):
+ (WebCore::LegacyTileGridTile::LegacyTileGridTile):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::createGraphicsLayer):
+
</ins><span class="cx"> 2016-03-10 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r197922.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -105,6 +105,22 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if !USE(CA)
+bool GraphicsLayer::supportsSmoothedLayerText()
+{
+ return false;
+}
+
+void GraphicsLayer::setSmoothedLayerTextEnabled(bool)
+{
+}
+
+bool GraphicsLayer::smoothedLayerTextEnabled()
+{
+ return false;
+}
+#endif
+
</ins><span class="cx"> GraphicsLayer::GraphicsLayer(Type type, GraphicsLayerClient& client)
</span><span class="cx"> : m_client(client)
</span><span class="cx"> , m_anchorPoint(0.5f, 0.5f, 0)
</span><span class="lines">@@ -115,6 +131,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_contentsOpaque(false)
</span><ins>+ , m_supportsSmoothedFonts(false)
</ins><span class="cx"> , m_preserves3D(false)
</span><span class="cx"> , m_backfaceVisibility(true)
</span><span class="cx"> , m_usingTiledBacking(false)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -364,6 +364,9 @@
</span><span class="cx"> bool contentsOpaque() const { return m_contentsOpaque; }
</span><span class="cx"> virtual void setContentsOpaque(bool b) { m_contentsOpaque = b; }
</span><span class="cx">
</span><ins>+ bool supportsSmoothedFonts() const { return m_supportsSmoothedFonts; }
+ virtual void setSupportsSmoothedFonts(bool b) { m_supportsSmoothedFonts = b; }
+
</ins><span class="cx"> bool backfaceVisibility() const { return m_backfaceVisibility; }
</span><span class="cx"> virtual void setBackfaceVisibility(bool b) { m_backfaceVisibility = b; }
</span><span class="cx">
</span><span class="lines">@@ -540,7 +543,11 @@
</span><span class="cx"> static bool supportsBackgroundColorContent();
</span><span class="cx"> static bool supportsLayerType(Type);
</span><span class="cx"> static bool supportsContentsTiling();
</span><ins>+ static bool supportsSmoothedLayerText();
</ins><span class="cx">
</span><ins>+ WEBCORE_EXPORT static void setSmoothedLayerTextEnabled(bool);
+ WEBCORE_EXPORT static bool smoothedLayerTextEnabled();
+
</ins><span class="cx"> void updateDebugIndicators();
</span><span class="cx">
</span><span class="cx"> virtual bool canThrottleLayerFlush() const { return false; }
</span><span class="lines">@@ -613,6 +620,7 @@
</span><span class="cx"> const Type m_type;
</span><span class="cx">
</span><span class="cx"> bool m_contentsOpaque : 1;
</span><ins>+ bool m_supportsSmoothedFonts : 1;
</ins><span class="cx"> bool m_preserves3D: 1;
</span><span class="cx"> bool m_backfaceVisibility : 1;
</span><span class="cx"> bool m_usingTiledBacking : 1;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsTiledBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/TiledBacking.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/TiledBacking.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/TiledBacking.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -79,6 +79,8 @@
</span><span class="cx"> virtual void setTiledScrollingIndicatorPosition(const FloatPoint&) = 0;
</span><span class="cx"> virtual void setTopContentInset(float) = 0;
</span><span class="cx">
</span><ins>+ virtual void setTileContentsFormatFlags(unsigned) = 0;
+
</ins><span class="cx"> virtual void setVelocity(const VelocityData&) = 0;
</span><span class="cx">
</span><span class="cx"> enum {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -309,6 +309,26 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static bool isSmoothedLayerTextEnabled = true;
+
+bool GraphicsLayer::supportsSmoothedLayerText()
+{
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ return isSmoothedLayerTextEnabled;
+#endif
+ return false;
+}
+
+void GraphicsLayer::setSmoothedLayerTextEnabled(bool flag)
+{
+ isSmoothedLayerTextEnabled = flag;
+}
+
+bool GraphicsLayer::smoothedLayerTextEnabled()
+{
+ return isSmoothedLayerTextEnabled;
+}
+
</ins><span class="cx"> std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType)
</span><span class="cx"> {
</span><span class="cx"> std::unique_ptr<GraphicsLayer> graphicsLayer;
</span><span class="lines">@@ -709,6 +729,15 @@
</span><span class="cx"> noteLayerPropertyChanged(ContentsOpaqueChanged);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void GraphicsLayerCA::setSupportsSmoothedFonts(bool supportsSmoothedFonts)
+{
+ if (m_supportsSmoothedFonts == supportsSmoothedFonts)
+ return;
+
+ GraphicsLayer::setSupportsSmoothedFonts(supportsSmoothedFonts);
+ noteLayerPropertyChanged(ContentsFormatChanged);
+}
+
</ins><span class="cx"> void GraphicsLayerCA::setBackfaceVisibility(bool visible)
</span><span class="cx"> {
</span><span class="cx"> if (m_backfaceVisibility == visible)
</span><span class="lines">@@ -1580,6 +1609,9 @@
</span><span class="cx"> if (m_uncommittedChanges & ContentsOpaqueChanged)
</span><span class="cx"> updateContentsOpaque(pageScaleFactor);
</span><span class="cx">
</span><ins>+ if (m_uncommittedChanges & ContentsFormatChanged)
+ updateContentsFormat();
+
</ins><span class="cx"> if (m_uncommittedChanges & BackfaceVisibilityChanged)
</span><span class="cx"> updateBackfaceVisibility();
</span><span class="cx">
</span><span class="lines">@@ -1890,6 +1922,20 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void GraphicsLayerCA::updateContentsFormat()
+{
+ PlatformCALayer::ContentsFormatFlags formatFlags = 0;
+ if (supportsSmoothedFonts())
+ formatFlags |= PlatformCALayer::SmoothedFonts;
+
+ m_layer->setContentsFormat(formatFlags);
+
+ if (LayerMap* layerCloneMap = m_layerClones.get()) {
+ for (auto& layer : layerCloneMap->values())
+ layer->setContentsFormat(formatFlags);
+ }
+}
+
</ins><span class="cx"> void GraphicsLayerCA::updateBackfaceVisibility()
</span><span class="cx"> {
</span><span class="cx"> if (m_structuralLayer && structuralLayerPurpose() == StructuralLayerForReplicaFlattening) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -95,6 +95,8 @@
</span><span class="cx"> WEBCORE_EXPORT void setBackgroundColor(const Color&) override;
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void setContentsOpaque(bool) override;
</span><ins>+ WEBCORE_EXPORT void setSupportsSmoothedFonts(bool) override;
+
</ins><span class="cx"> WEBCORE_EXPORT void setBackfaceVisibility(bool) override;
</span><span class="cx">
</span><span class="cx"> // return true if we started an animation
</span><span class="lines">@@ -391,6 +393,7 @@
</span><span class="cx"> void updateMasksToBounds();
</span><span class="cx"> void updateContentsVisibility();
</span><span class="cx"> void updateContentsOpaque(float pageScaleFactor);
</span><ins>+ void updateContentsFormat();
</ins><span class="cx"> void updateBackfaceVisibility();
</span><span class="cx"> void updateStructuralLayer();
</span><span class="cx"> void updateDrawsContent();
</span><span class="lines">@@ -455,43 +458,44 @@
</span><span class="cx"> bool appendToUncommittedAnimations(const KeyframeValueList&, const FilterOperation*, const Animation*, const String& animationName, int animationIndex, double timeOffset);
</span><span class="cx">
</span><span class="cx"> enum LayerChange : uint64_t {
</span><del>- NoChange = 0,
- NameChanged = 1LLU << 1,
- ChildrenChanged = 1LLU << 2, // also used for content layer, and preserves-3d, and size if tiling changes?
- GeometryChanged = 1LLU << 3,
- TransformChanged = 1LLU << 4,
- ChildrenTransformChanged = 1LLU << 5,
- Preserves3DChanged = 1LLU << 6,
- MasksToBoundsChanged = 1LLU << 7,
- DrawsContentChanged = 1LLU << 8,
- BackgroundColorChanged = 1LLU << 9,
- ContentsOpaqueChanged = 1LLU << 10,
- BackfaceVisibilityChanged = 1LLU << 11,
- OpacityChanged = 1LLU << 12,
- AnimationChanged = 1LLU << 13,
- DirtyRectsChanged = 1LLU << 14,
- ContentsImageChanged = 1LLU << 15,
- ContentsPlatformLayerChanged = 1LLU << 16,
- ContentsColorLayerChanged = 1LLU << 17,
- ContentsRectsChanged = 1LLU << 18,
- MasksToBoundsRectChanged = 1LLU << 19,
- MaskLayerChanged = 1LLU << 20,
- ReplicatedLayerChanged = 1LLU << 21,
- ContentsNeedsDisplay = 1LLU << 22,
- AcceleratesDrawingChanged = 1LLU << 23,
- ContentsScaleChanged = 1LLU << 24,
- ContentsVisibilityChanged = 1LLU << 25,
- CoverageRectChanged = 1LLU << 26,
- FiltersChanged = 1LLU << 27,
- BackdropFiltersChanged = 1LLU << 28,
- BackdropFiltersRectChanged = 1LLU << 29,
- TilingAreaChanged = 1LLU << 30,
- TilesAdded = 1LLU << 31,
- DebugIndicatorsChanged = 1LLU << 32,
- CustomAppearanceChanged = 1LLU << 33,
- BlendModeChanged = 1LLU << 34,
- ShapeChanged = 1LLU << 35,
- WindRuleChanged = 1LLU << 36,
</del><ins>+ NoChange = 0,
+ NameChanged = 1LLU << 1,
+ ChildrenChanged = 1LLU << 2, // also used for content layer, and preserves-3d, and size if tiling changes?
+ GeometryChanged = 1LLU << 3,
+ TransformChanged = 1LLU << 4,
+ ChildrenTransformChanged = 1LLU << 5,
+ Preserves3DChanged = 1LLU << 6,
+ MasksToBoundsChanged = 1LLU << 7,
+ DrawsContentChanged = 1LLU << 8,
+ BackgroundColorChanged = 1LLU << 9,
+ ContentsOpaqueChanged = 1LLU << 10,
+ ContentsFormatChanged = 1LLU << 11,
+ BackfaceVisibilityChanged = 1LLU << 12,
+ OpacityChanged = 1LLU << 13,
+ AnimationChanged = 1LLU << 14,
+ DirtyRectsChanged = 1LLU << 15,
+ ContentsImageChanged = 1LLU << 16,
+ ContentsPlatformLayerChanged = 1LLU << 17,
+ ContentsColorLayerChanged = 1LLU << 18,
+ ContentsRectsChanged = 1LLU << 19,
+ MasksToBoundsRectChanged = 1LLU << 20,
+ MaskLayerChanged = 1LLU << 21,
+ ReplicatedLayerChanged = 1LLU << 22,
+ ContentsNeedsDisplay = 1LLU << 23,
+ AcceleratesDrawingChanged = 1LLU << 24,
+ ContentsScaleChanged = 1LLU << 25,
+ ContentsVisibilityChanged = 1LLU << 26,
+ CoverageRectChanged = 1LLU << 27,
+ FiltersChanged = 1LLU << 28,
+ BackdropFiltersChanged = 1LLU << 29,
+ BackdropFiltersRectChanged = 1LLU << 30,
+ TilingAreaChanged = 1LLU << 31,
+ TilesAdded = 1LLU << 32,
+ DebugIndicatorsChanged = 1LLU << 33,
+ CustomAppearanceChanged = 1LLU << 34,
+ BlendModeChanged = 1LLU << 35,
+ ShapeChanged = 1LLU << 36,
+ WindRuleChanged = 1LLU << 37,
</ins><span class="cx"> };
</span><span class="cx"> typedef uint64_t LayerChangeFlags;
</span><span class="cx"> enum ScheduleFlushOrNot { ScheduleFlush, DontScheduleFlush };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -80,11 +80,6 @@
</span><span class="cx"> CGContextSetRGBFillColor(context, 0, 0.5f, 0.25f, 1);
</span><span class="cx">
</span><span class="cx"> CGContextFillRect(context, indicatorBox);
</span><del>-
- if (platformCALayer->acceleratesDrawing())
- CGContextSetRGBFillColor(context, 1, 0, 0, 1);
- else
- CGContextSetRGBFillColor(context, 1, 1, 1, 1);
</del><span class="cx">
</span><span class="cx"> if (platformCALayer->owner()->isUsingDisplayListDrawing(platformCALayer)) {
</span><span class="cx"> CGContextSetRGBStrokeColor(context, 0, 0, 0, 0.65);
</span><span class="lines">@@ -92,6 +87,16 @@
</span><span class="cx"> CGContextStrokeRect(context, indicatorBox);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (!platformCALayer->isOpaque() && (platformCALayer->contentsFormat() & SmoothedFonts)) {
+ CGContextSetRGBFillColor(context, 1, 1, 1, 0.4);
+ platformCALayer->drawTextAtPoint(context, indicatorBox.origin.x + 7, indicatorBox.origin.y + 24, CGSizeMake(1, -1), 22, text, strlen(text));
+ }
+
+ if (platformCALayer->acceleratesDrawing())
+ CGContextSetRGBFillColor(context, 1, 0, 0, 1);
+ else
+ CGContextSetRGBFillColor(context, 1, 1, 1, 1);
+
</ins><span class="cx"> platformCALayer->drawTextAtPoint(context, indicatorBox.origin.x + 5, indicatorBox.origin.y + 22, CGSizeMake(1, -1), 22, text, strlen(text));
</span><span class="cx">
</span><span class="cx"> CGContextEndTransparencyLayer(context);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -139,6 +139,14 @@
</span><span class="cx"> virtual bool isOpaque() const = 0;
</span><span class="cx"> virtual void setOpaque(bool) = 0;
</span><span class="cx">
</span><ins>+ enum ContentsFormatFlag {
+ DeepColor = 1 << 0,
+ SmoothedFonts = 1 << 1,
+ };
+ typedef unsigned ContentsFormatFlags;
+ virtual void setContentsFormat(ContentsFormatFlags) = 0;
+ virtual ContentsFormatFlags contentsFormat() const = 0;
+
</ins><span class="cx"> virtual FloatRect bounds() const = 0;
</span><span class="cx"> virtual void setBounds(const FloatRect&) = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -175,6 +175,15 @@
</span><span class="cx"> tileGrid().updateTileLayerProperties();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void TileController::setTileContentsFormatFlags(PlatformCALayer::ContentsFormatFlags flags)
+{
+ if (flags == m_contentsFormatFlags)
+ return;
+
+ m_contentsFormatFlags = flags;
+ tileGrid().updateTileLayerProperties();
+}
+
</ins><span class="cx"> void TileController::setVisibleRect(const FloatRect& rect)
</span><span class="cx"> {
</span><span class="cx"> if (rect == m_visibleRect)
</span><span class="lines">@@ -675,6 +684,7 @@
</span><span class="cx"> layer->setBorderWidth(m_tileDebugBorderWidth);
</span><span class="cx"> layer->setEdgeAntialiasingMask(0);
</span><span class="cx"> layer->setOpaque(m_tilesAreOpaque);
</span><ins>+ layer->setContentsFormat(m_contentsFormatFlags);
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> layer->setName("Tile");
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -78,6 +78,9 @@
</span><span class="cx"> WEBCORE_EXPORT void setTilesOpaque(bool);
</span><span class="cx"> bool tilesAreOpaque() const { return m_tilesAreOpaque; }
</span><span class="cx">
</span><ins>+ void setTileContentsFormatFlags(PlatformCALayer::ContentsFormatFlags) override;
+ PlatformCALayer::ContentsFormatFlags tileContentsFormatFlags() const { return m_contentsFormatFlags; }
+
</ins><span class="cx"> PlatformCALayer& rootLayer() { return *m_tileCacheLayer; }
</span><span class="cx"> const PlatformCALayer& rootLayer() const { return *m_tileCacheLayer; }
</span><span class="cx">
</span><span class="lines">@@ -206,6 +209,8 @@
</span><span class="cx">
</span><span class="cx"> int m_marginSize { kDefaultTileSize };
</span><span class="cx">
</span><ins>+ PlatformCALayer::ContentsFormatFlags m_contentsFormatFlags { 0 };
+
</ins><span class="cx"> // m_marginTop and m_marginBottom are the height in pixels of the top and bottom margin tiles. The width
</span><span class="cx"> // of those tiles will be equivalent to the width of the other tiles in the grid. m_marginRight and
</span><span class="cx"> // m_marginLeft are the width in pixels of the right and left margin tiles, respectively. The height of
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -175,6 +175,7 @@
</span><span class="cx"> {
</span><span class="cx"> bool acceleratesDrawing = m_controller.acceleratesDrawing();
</span><span class="cx"> bool opaque = m_controller.tilesAreOpaque();
</span><ins>+ PlatformCALayer::ContentsFormatFlags formatFlags = m_controller.tileContentsFormatFlags();
</ins><span class="cx"> Color tileDebugBorderColor = m_controller.tileDebugBorderColor();
</span><span class="cx"> float tileDebugBorderWidth = m_controller.tileDebugBorderWidth();
</span><span class="cx">
</span><span class="lines">@@ -182,6 +183,7 @@
</span><span class="cx"> const TileInfo& tileInfo = it->value;
</span><span class="cx"> tileInfo.layer->setAcceleratesDrawing(acceleratesDrawing);
</span><span class="cx"> tileInfo.layer->setOpaque(opaque);
</span><ins>+ tileInfo.layer->setContentsFormat(formatFlags);
</ins><span class="cx"> tileInfo.layer->setBorderColor(tileDebugBorderColor);
</span><span class="cx"> tileInfo.layer->setBorderWidth(tileDebugBorderWidth);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -72,6 +72,9 @@
</span><span class="cx"> bool isOpaque() const override;
</span><span class="cx"> void setOpaque(bool) override;
</span><span class="cx">
</span><ins>+ void setContentsFormat(ContentsFormatFlags) override;
+ ContentsFormatFlags contentsFormat() const override { return m_contentsFormatFlags; }
+
</ins><span class="cx"> FloatRect bounds() const override;
</span><span class="cx"> void setBounds(const FloatRect&) override;
</span><span class="cx">
</span><span class="lines">@@ -179,6 +182,7 @@
</span><span class="cx"> std::unique_ptr<PlatformCALayerList> m_customSublayers;
</span><span class="cx"> GraphicsLayer::CustomAppearance m_customAppearance;
</span><span class="cx"> std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect;
</span><ins>+ ContentsFormatFlags m_contentsFormatFlags { 0 };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> #import <WebKitAdditions/LayerBackingStoreAdditions.mm>
</span><span class="cx"> #else
</span><span class="cx"> namespace WebCore {
</span><del>-static void setBackingStoreFormat(CALayer *)
</del><ins>+static void setBackingStoreFormat(CALayer *, PlatformCALayer::ContentsFormatFlags)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> } // namespace WebCore
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx"> [m_layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</span><span class="cx">
</span><span class="cx"> if (m_layerType == LayerTypeWebLayer || m_layerType == LayerTypeTiledBackingTileLayer)
</span><del>- setBackingStoreFormat(m_layer.get());
</del><ins>+ setBackingStoreFormat(m_layer.get(), 0);
</ins><span class="cx">
</span><span class="cx"> // So that the scrolling thread's performance logging code can find all the tiles, mark this as being a tile.
</span><span class="cx"> if (m_layerType == LayerTypeTiledBackingTileLayer)
</span><span class="lines">@@ -545,6 +545,22 @@
</span><span class="cx"> END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PlatformCALayerCocoa::setContentsFormat(ContentsFormatFlags flags)
+{
+ if (flags == m_contentsFormatFlags)
+ return;
+
+ m_contentsFormatFlags = flags;
+
+ if (usesTiledBackingLayer()) {
+ WebTiledBackingLayer* tiledBackingLayer = static_cast<WebTiledBackingLayer*>(m_layer.get());
+ tiledBackingLayer.tiledBacking->setTileContentsFormatFlags(flags);
+ return;
+ }
+
+ setBackingStoreFormat(m_layer.get(), flags);
+}
+
</ins><span class="cx"> FloatRect PlatformCALayerCocoa::bounds() const
</span><span class="cx"> {
</span><span class="cx"> return [m_layer bounds];
</span><span class="lines">@@ -1056,7 +1072,7 @@
</span><span class="cx"> graphicsContext.setIsCALayerContext(true);
</span><span class="cx"> graphicsContext.setIsAcceleratedContext(platformCALayer->acceleratesDrawing());
</span><span class="cx">
</span><del>- if (!layerContents->platformCALayerContentsOpaque()) {
</del><ins>+ if (!layerContents->platformCALayerContentsOpaque() && !(platformCALayer->contentsFormat() & SmoothedFonts)) {
</ins><span class="cx"> // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
</span><span class="cx"> graphicsContext.setShouldSmoothFonts(false);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -377,6 +377,16 @@
</span><span class="cx"> setNeedsCommit();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PlatformCALayerWin::setContentsFormat(ContentsFormatFlags formatFlags)
+{
+ m_contentsFormat = formatFlags;
+}
+
+PlatformCALayer::ContentsFormatFlags PlatformCALayerWin::contentsFormat() const
+{
+ return m_contentsFormat;
+}
+
</ins><span class="cx"> FloatRect PlatformCALayerWin::bounds() const
</span><span class="cx"> {
</span><span class="cx"> return CACFLayerGetBounds(m_layer.get());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -64,6 +64,9 @@
</span><span class="cx"> bool isOpaque() const override;
</span><span class="cx"> void setOpaque(bool) override;
</span><span class="cx">
</span><ins>+ void setContentsFormat(ContentsFormatFlags) override;
+ ContentsFormatFlags contentsFormat() const override;
+
</ins><span class="cx"> FloatRect bounds() const override;
</span><span class="cx"> void setBounds(const FloatRect&) override;
</span><span class="cx">
</span><span class="lines">@@ -163,6 +166,7 @@
</span><span class="cx"> HashMap<String, RefPtr<PlatformCAAnimation>> m_animations;
</span><span class="cx"> std::unique_ptr<PlatformCALayerList> m_customSublayers;
</span><span class="cx"> GraphicsLayer::CustomAppearance m_customAppearance;
</span><ins>+ ContentsFormatFlags m_contentsFormat { 0 };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosLegacyTileGridTilemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -28,11 +28,13 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">
</span><ins>+#include "BlockExceptions.h"
</ins><span class="cx"> #include "Color.h"
</span><span class="cx"> #include "LegacyTileCache.h"
</span><span class="cx"> #include "LegacyTileGrid.h"
</span><span class="cx"> #include "LegacyTileLayer.h"
</span><span class="cx"> #include "LegacyTileLayerPool.h"
</span><ins>+#include "PlatformCALayer.h"
</ins><span class="cx"> #include "QuartzCoreSPI.h"
</span><span class="cx"> #include "WAKWindow.h"
</span><span class="cx"> #include <algorithm>
</span><span class="lines">@@ -43,7 +45,7 @@
</span><span class="cx"> #import <WebKitAdditions/LayerBackingStoreAdditions.mm>
</span><span class="cx"> #else
</span><span class="cx"> namespace WebCore {
</span><del>-static void setBackingStoreFormat(CALayer *)
</del><ins>+static void setBackingStoreFormat(CALayer *, PlatformCALayer::ContentsFormatFlags)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> } // namespace WebCore
</span><span class="lines">@@ -71,7 +73,7 @@
</span><span class="cx"> m_tileLayer = adoptNS([[LegacyTileLayer alloc] init]);
</span><span class="cx"> }
</span><span class="cx"> LegacyTileLayer* layer = m_tileLayer.get();
</span><del>- setBackingStoreFormat(layer);
</del><ins>+ setBackingStoreFormat(layer, 0);
</ins><span class="cx"> [layer setTileGrid:tileGrid];
</span><span class="cx"> [layer setOpaque:m_tileGrid->tileCache().tilesOpaque()];
</span><span class="cx"> [layer setEdgeAntialiasingMask:0];
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -178,6 +178,10 @@
</span><span class="cx"> graphicsLayer->setAcceleratesDrawing(compositor().acceleratedDrawingEnabled());
</span><span class="cx"> graphicsLayer->setUsesDisplayListDrawing(compositor().displayListDrawingEnabled());
</span><span class="cx"> #endif
</span><ins>+
+ // FIXME: ideally we'd only do this if the layer contains smoothed text.
+ if (GraphicsLayer::supportsSmoothedLayerText())
+ graphicsLayer->setSupportsSmoothedFonts(true);
</ins><span class="cx">
</span><span class="cx"> return graphicsLayer;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-10 Simon Fraser <simon.fraser@apple.com>
+
+ Font antialiasing (smoothing) changes when elements are rendered into compositing layers
+ https://bugs.webkit.org/show_bug.cgi?id=23364
+
+ Reviewed by Tim Horton.
+
+ Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
+ can disable it.
+
+ * WebView/WebView.mm:
+ (+[WebView _setSmoothedLayerTextEnabled:]):
+ (+[WebView _smoothedLayerTextEnabled]):
+ * WebView/WebViewPrivate.h:
+
</ins><span class="cx"> 2016-03-10 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> Add WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -140,6 +140,7 @@
</span><span class="cx"> #import <WebCore/GCController.h>
</span><span class="cx"> #import <WebCore/GeolocationController.h>
</span><span class="cx"> #import <WebCore/GeolocationError.h>
</span><ins>+#import <WebCore/GraphicsLayer.h>
</ins><span class="cx"> #import <WebCore/HTMLNames.h>
</span><span class="cx"> #import <WebCore/HTMLVideoElement.h>
</span><span class="cx"> #import <WebCore/HistoryController.h>
</span><span class="lines">@@ -3236,6 +3237,16 @@
</span><span class="cx"> return FontCascade::shouldUseSmoothing();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>++ (void)_setSmoothedLayerTextEnabled:(BOOL)f
+{
+ GraphicsLayer::setSmoothedLayerTextEnabled(f);
+}
+
++ (BOOL)_smoothedLayerTextEnabled
+{
+ return GraphicsLayer::smoothedLayerTextEnabled();
+}
+
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> + (void)_setUsesTestModeFocusRingColor:(BOOL)f
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewPrivate.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewPrivate.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit/mac/WebView/WebViewPrivate.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -532,6 +532,9 @@
</span><span class="cx"> + (void)_setShouldUseFontSmoothing:(BOOL)f;
</span><span class="cx"> + (BOOL)_shouldUseFontSmoothing;
</span><span class="cx">
</span><ins>++ (void)_setSmoothedLayerTextEnabled:(BOOL)f;
++ (BOOL)_smoothedLayerTextEnabled;
+
</ins><span class="cx"> #if !TARGET_OS_IPHONE
</span><span class="cx"> // These two methods are useful for a test harness that needs a consistent appearance for the focus rings
</span><span class="cx"> // regardless of OS X version.
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2016-03-10 Simon Fraser <simon.fraser@apple.com>
+
+ Font antialiasing (smoothing) changes when elements are rendered into compositing layers
+ https://bugs.webkit.org/show_bug.cgi?id=23364
+
+ Reviewed by Tim Horton.
+
+ Send the ContentsFormat to the UI process (but nothing happens to it there yet).
+
+ Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
+ can disable it.
+
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
+ (WebKit::WebProcessCreationParameters::encode):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ * Shared/mac/RemoteLayerTreeTransaction.h:
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextEnableSmoothedLayerText):
+ * UIProcess/API/C/WKContextPrivate.h:
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::createNewWebProcess):
+ (WebKit::WebProcessPool::enableSmoothedLayerText):
+ (WebKit::WebProcessPool::WebProcessPool): Deleted.
+ * UIProcess/WebProcessPool.h:
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+ (WebKit::PlatformCALayerRemote::setContentsFormat):
+ (WebKit::PlatformCALayerRemote::contentsFormat):
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+ (WebKit::WebProcess::enableSmoothedLayerText):
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in:
+
</ins><span class="cx"> 2016-03-10 Enrica Casucci <enrica@apple.com>
</span><span class="cx">
</span><span class="cx"> Expose additional WKDataDetectorTypes.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -35,20 +35,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> WebProcessCreationParameters::WebProcessCreationParameters()
</span><del>- : shouldAlwaysUseComplexTextCodePath(false)
- , shouldEnableMemoryPressureReliefLogging(false)
- , shouldUseFontSmoothing(true)
- , defaultRequestTimeoutInterval(INT_MAX)
-#if PLATFORM(COCOA)
- , shouldEnableJIT(false)
- , shouldEnableFTLJIT(false)
-#endif
- , memoryCacheDisabled(false)
-#if ENABLE(SERVICE_CONTROLS)
- , hasImageServices(false)
- , hasSelectionServices(false)
- , hasRichContentServices(false)
-#endif
</del><ins>+ : defaultRequestTimeoutInterval(INT_MAX)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -96,6 +83,7 @@
</span><span class="cx"> encoder << shouldEnableMemoryPressureReliefLogging;
</span><span class="cx"> encoder << shouldSuppressMemoryPressureHandler;
</span><span class="cx"> encoder << shouldUseFontSmoothing;
</span><ins>+ encoder << enabledSmoothedLayerText;
</ins><span class="cx"> encoder << resourceLoadStatisticsEnabled;
</span><span class="cx"> encoder << fontWhitelist;
</span><span class="cx"> encoder << iconDatabaseEnabled;
</span><span class="lines">@@ -214,6 +202,8 @@
</span><span class="cx"> return false;
</span><span class="cx"> if (!decoder.decode(parameters.shouldUseFontSmoothing))
</span><span class="cx"> return false;
</span><ins>+ if (!decoder.decode(parameters.enabledSmoothedLayerText))
+ return false;
</ins><span class="cx"> if (!decoder.decode(parameters.resourceLoadStatisticsEnabled))
</span><span class="cx"> return false;
</span><span class="cx"> if (!decoder.decode(parameters.fontWhitelist))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -103,10 +103,11 @@
</span><span class="cx">
</span><span class="cx"> CacheModel cacheModel;
</span><span class="cx">
</span><del>- bool shouldAlwaysUseComplexTextCodePath;
- bool shouldEnableMemoryPressureReliefLogging;
</del><ins>+ bool shouldAlwaysUseComplexTextCodePath { false };
+ bool shouldEnableMemoryPressureReliefLogging { false };
</ins><span class="cx"> bool shouldSuppressMemoryPressureHandler { false };
</span><del>- bool shouldUseFontSmoothing;
</del><ins>+ bool shouldUseFontSmoothing { true };
+ bool enabledSmoothedLayerText { true };
</ins><span class="cx"> bool resourceLoadStatisticsEnabled { false };
</span><span class="cx">
</span><span class="cx"> Vector<String> fontWhitelist;
</span><span class="lines">@@ -138,8 +139,8 @@
</span><span class="cx"> String uiProcessBundleResourcePath;
</span><span class="cx"> SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
</span><span class="cx">
</span><del>- bool shouldEnableJIT;
- bool shouldEnableFTLJIT;
</del><ins>+ bool shouldEnableJIT { false };
+ bool shouldEnableFTLJIT { false };
</ins><span class="cx">
</span><span class="cx"> RefPtr<API::Data> bundleParameterData;
</span><span class="cx">
</span><span class="lines">@@ -152,12 +153,12 @@
</span><span class="cx"> HashMap<WebCore::SessionID, HashMap<unsigned, double>> plugInAutoStartOriginHashes;
</span><span class="cx"> Vector<String> plugInAutoStartOrigins;
</span><span class="cx">
</span><del>- bool memoryCacheDisabled;
</del><ins>+ bool memoryCacheDisabled { false };
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>- bool hasImageServices;
- bool hasSelectionServices;
- bool hasRichContentServices;
</del><ins>+ bool hasImageServices { false };
+ bool hasSelectionServices { false };
+ bool hasRichContentServices { false };
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -87,7 +87,8 @@
</span><span class="cx"> FiltersChanged = 1LLU << 32,
</span><span class="cx"> AnimationsChanged = 1LLU << 33,
</span><span class="cx"> EdgeAntialiasingMaskChanged = 1LLU << 34,
</span><del>- CustomAppearanceChanged = 1LLU << 35,
</del><ins>+ ContentsFormatFlagsChanged = 1LLU << 35,
+ CustomAppearanceChanged = 1LLU << 36,
</ins><span class="cx"> };
</span><span class="cx"> typedef uint64_t LayerChange;
</span><span class="cx">
</span><span class="lines">@@ -153,6 +154,7 @@
</span><span class="cx"> WebCore::Color backgroundColor;
</span><span class="cx"> WebCore::Color borderColor;
</span><span class="cx"> unsigned edgeAntialiasingMask;
</span><ins>+ WebCore::PlatformCALayer::ContentsFormatFlags contentsFormatFlags;
</ins><span class="cx"> WebCore::GraphicsLayer::CustomAppearance customAppearance;
</span><span class="cx"> WebCore::PlatformCALayer::FilterType minificationFilter;
</span><span class="cx"> WebCore::PlatformCALayer::FilterType magnificationFilter;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -211,6 +211,9 @@
</span><span class="cx"> if (changedProperties & OpaqueChanged)
</span><span class="cx"> encoder << opaque;
</span><span class="cx">
</span><ins>+ if (changedProperties & ContentsFormatFlagsChanged)
+ encoder << contentsFormatFlags;
+
</ins><span class="cx"> if (changedProperties & MaskLayerChanged)
</span><span class="cx"> encoder << maskLayerID;
</span><span class="cx">
</span><span class="lines">@@ -374,6 +377,11 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (result.changedProperties & ContentsFormatFlagsChanged) {
+ if (!decoder.decode(result.contentsFormatFlags))
+ return false;
+ }
+
</ins><span class="cx"> if (result.changedProperties & MaskLayerChanged) {
</span><span class="cx"> if (!decoder.decode(result.maskLayerID))
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -347,6 +347,11 @@
</span><span class="cx"> toImpl(contextRef)->setShouldUseFontSmoothing(useFontSmoothing);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WKContextEnableSmoothedLayerText(WKContextRef contextRef, bool smoothedLayerText)
+{
+ toImpl(contextRef)->enableSmoothedLayerText(smoothedLayerText);
+}
+
</ins><span class="cx"> void WKContextSetAdditionalPluginsDirectory(WKContextRef contextRef, WKStringRef pluginsDirectory)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKContextPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx">
</span><span class="cx"> WK_EXPORT void WKContextSetShouldUseFontSmoothing(WKContextRef context, bool useFontSmoothing);
</span><span class="cx">
</span><ins>+WK_EXPORT void WKContextEnableSmoothedLayerText(WKContextRef context, bool);
+
</ins><span class="cx"> WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKStringRef urlScheme);
</span><span class="cx">
</span><span class="cx"> WK_EXPORT void WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy(WKContextRef context, WKStringRef urlScheme);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -148,8 +148,6 @@
</span><span class="cx"> , m_visitedLinkStore(VisitedLinkStore::create())
</span><span class="cx"> , m_visitedLinksPopulated(false)
</span><span class="cx"> , m_plugInAutoStartProvider(this)
</span><del>- , m_alwaysUsesComplexTextCodePath(false)
- , m_shouldUseFontSmoothing(true)
</del><span class="cx"> , m_memorySamplerEnabled(false)
</span><span class="cx"> , m_memorySamplerInterval(1400.0)
</span><span class="cx"> , m_websiteDataStore(m_configuration->shouldHaveLegacyDataStore() ? API::WebsiteDataStore::create(legacyWebsiteDataStoreConfiguration(m_configuration)).ptr() : nullptr)
</span><span class="lines">@@ -586,6 +584,7 @@
</span><span class="cx">
</span><span class="cx"> parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
</span><span class="cx"> parameters.shouldUseFontSmoothing = m_shouldUseFontSmoothing;
</span><ins>+ parameters.enabledSmoothedLayerText = m_enabledSmoothedLayerText;
</ins><span class="cx">
</span><span class="cx"> // FIXME: This leaves UI process and WebProcess disagreeing about the state if the client hasn't set the path.
</span><span class="cx"> // iconDatabasePath is non-empty by default, but m_iconDatabase isn't enabled in UI process unless setDatabasePath is called explicitly.
</span><span class="lines">@@ -872,6 +871,12 @@
</span><span class="cx"> sendToAllProcesses(Messages::WebProcess::SetShouldUseFontSmoothing(useFontSmoothing));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebProcessPool::enableSmoothedLayerText(bool enableSmoothedText)
+{
+ m_enabledSmoothedLayerText = enableSmoothedText;
+ sendToAllProcesses(Messages::WebProcess::EnableSmoothedLayerText(enableSmoothedText));
+}
+
</ins><span class="cx"> void WebProcessPool::registerURLSchemeAsEmptyDocument(const String& urlScheme)
</span><span class="cx"> {
</span><span class="cx"> m_schemesToRegisterAsEmptyDocument.add(urlScheme);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -191,6 +191,7 @@
</span><span class="cx">
</span><span class="cx"> void setAlwaysUsesComplexTextCodePath(bool);
</span><span class="cx"> void setShouldUseFontSmoothing(bool);
</span><ins>+ void enableSmoothedLayerText(bool);
</ins><span class="cx">
</span><span class="cx"> void registerURLSchemeAsEmptyDocument(const String&);
</span><span class="cx"> void registerURLSchemeAsSecure(const String&);
</span><span class="lines">@@ -463,8 +464,9 @@
</span><span class="cx"> HashSet<String> m_schemesToRegisterAsCachePartitioned;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- bool m_alwaysUsesComplexTextCodePath;
- bool m_shouldUseFontSmoothing;
</del><ins>+ bool m_alwaysUsesComplexTextCodePath { false };
+ bool m_shouldUseFontSmoothing { true };
+ bool m_enabledSmoothedLayerText { true };
</ins><span class="cx">
</span><span class="cx"> Vector<String> m_fontWhitelist;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -401,6 +401,20 @@
</span><span class="cx"> m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::MaskLayerChanged);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PlatformCALayerRemote::setContentsFormat(ContentsFormatFlags formatFlags)
+{
+ if (formatFlags == m_properties.contentsFormatFlags)
+ return;
+
+ m_properties.contentsFormatFlags = formatFlags;
+ m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ContentsFormatFlagsChanged);
+}
+
+PlatformCALayer::ContentsFormatFlags PlatformCALayerRemote::contentsFormat() const
+{
+ return m_properties.contentsFormatFlags;
+}
+
</ins><span class="cx"> void PlatformCALayerRemote::setClonedLayer(const PlatformCALayer* layer)
</span><span class="cx"> {
</span><span class="cx"> if (isEquivalentLayer(layer, m_properties.clonedLayerID))
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -76,6 +76,9 @@
</span><span class="cx"> bool isOpaque() const override;
</span><span class="cx"> void setOpaque(bool) override;
</span><span class="cx">
</span><ins>+ void setContentsFormat(ContentsFormatFlags) override;
+ ContentsFormatFlags contentsFormat() const override;
+
</ins><span class="cx"> WebCore::FloatRect bounds() const override;
</span><span class="cx"> void setBounds(const WebCore::FloatRect&) override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx"> #include <WebCore/FrameLoader.h>
</span><span class="cx"> #include <WebCore/GCController.h>
</span><span class="cx"> #include <WebCore/GlyphPage.h>
</span><ins>+#include <WebCore/GraphicsLayer.h>
</ins><span class="cx"> #include <WebCore/IconDatabase.h>
</span><span class="cx"> #include <WebCore/JSDOMWindow.h>
</span><span class="cx"> #include <WebCore/Language.h>
</span><span class="lines">@@ -343,6 +344,8 @@
</span><span class="cx"> if (parameters.shouldUseFontSmoothing)
</span><span class="cx"> setShouldUseFontSmoothing(true);
</span><span class="cx">
</span><ins>+ enableSmoothedLayerText(parameters.enabledSmoothedLayerText);
+
</ins><span class="cx"> #if PLATFORM(COCOA) || USE(CFNETWORK)
</span><span class="cx"> setApplicationBundleIdentifier(parameters.uiProcessBundleIdentifier);
</span><span class="cx"> SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
</span><span class="lines">@@ -476,6 +479,11 @@
</span><span class="cx"> WebCore::FontCascade::setShouldUseSmoothing(useFontSmoothing);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebProcess::enableSmoothedLayerText(bool smoothedLayerText)
+{
+ WebCore::GraphicsLayer::setSmoothedLayerTextEnabled(smoothedLayerText);
+}
+
</ins><span class="cx"> void WebProcess::userPreferredLanguagesChanged(const Vector<String>& languages) const
</span><span class="cx"> {
</span><span class="cx"> overrideUserPreferredLanguages(languages);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -238,6 +238,8 @@
</span><span class="cx"> void setDefaultRequestTimeoutInterval(double);
</span><span class="cx"> void setAlwaysUsesComplexTextCodePath(bool);
</span><span class="cx"> void setShouldUseFontSmoothing(bool);
</span><ins>+ void enableSmoothedLayerText(bool);
+
</ins><span class="cx"> void setResourceLoadStatisticsEnabled(bool);
</span><span class="cx"> void userPreferredLanguagesChanged(const Vector<String>&) const;
</span><span class="cx"> void fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> SetDefaultRequestTimeoutInterval(double timeoutInterval)
</span><span class="cx"> SetAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
</span><span class="cx"> SetShouldUseFontSmoothing(bool useFontSmoothing)
</span><ins>+ EnableSmoothedLayerText(bool smoothedLayerText)
</ins><span class="cx"> SetResourceLoadStatisticsEnabled(bool resourceLoadStatisticsEnabled);
</span><span class="cx"> UserPreferredLanguagesChanged(Vector<String> languages)
</span><span class="cx"> FullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Tools/ChangeLog        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-03-10 Simon Fraser <simon.fraser@apple.com>
+
+ Font antialiasing (smoothing) changes when elements are rendered into compositing layers
+ https://bugs.webkit.org/show_bug.cgi?id=23364
+
+ Reviewed by Tim Horton.
+
+ Turn off smoothed layer text because it affects many layout test results.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues):
+
</ins><span class="cx"> 2016-03-10 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> Partial roll-out of r197953; test fails because encode/decode support of those properties were never added.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -1847,6 +1847,7 @@
</span><span class="cx"> [[webView window] setAutodisplay:NO];
</span><span class="cx"> #endif
</span><span class="cx"> [webView setTracksRepaints:NO];
</span><ins>+ [WebView _setSmoothedLayerTextEnabled:NO];
</ins><span class="cx">
</span><span class="cx"> [WebCache clearCachedCredentials];
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (197980 => 197981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2016-03-11 01:46:31 UTC (rev 197980)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2016-03-11 01:49:22 UTC (rev 197981)
</span><span class="lines">@@ -717,6 +717,7 @@
</span><span class="cx"> WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), resetMessageBody.get());
</span><span class="cx">
</span><span class="cx"> WKContextSetShouldUseFontSmoothing(TestController::singleton().context(), false);
</span><ins>+ WKContextEnableSmoothedLayerText(TestController::singleton().context(), false);
</ins><span class="cx">
</span><span class="cx"> WKContextSetCacheModel(TestController::singleton().context(), kWKCacheModelDocumentBrowser);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>