<!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>[195156] 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/195156">195156</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2016-01-15 15:57:41 -0800 (Fri, 15 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make a way to test display-list drawing
https://bugs.webkit.org/show_bug.cgi?id=152956

Reviewed by Ryosuke Niwa.
Source/WebCore:

Make it possible to toggle display-list drawing for a given compositing
layer via internals, as well as getting a textual representation of the display
list, optionally including items with platform-specific behavior.

Add one test that uses this.

Test: displaylists/layer-dispay-list.html

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::displayListAsText):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::displayListAsText):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
(WebCore::DisplayList::DisplayList::asText):
* platform/graphics/displaylists/DisplayList.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setUsesDisplayListDrawing):
(WebCore::RenderLayerBacking::displayListAsText):
* rendering/RenderLayerBacking.h:
* testing/Internals.cpp:
(WebCore::Internals::setElementUsesDisplayListDrawing):
(WebCore::Internals::displayListForElement):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Enable displaylists tests on Mac and iOS.

* TestExpectations:
* displaylists/layer-dispay-list-expected.txt: Added.
* displaylists/layer-dispay-list.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerh">trunk/Source/WebCore/platform/graphics/GraphicsLayer.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="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListcpp">trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/displaylists/</li>
<li><a href="#trunkLayoutTestsdisplaylistslayerdispaylistexpectedtxt">trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsdisplaylistslayerdispaylisthtml">trunk/LayoutTests/displaylists/layer-dispay-list.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/LayoutTests/ChangeLog        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-01-10  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Make a way to test display-list drawing
+        https://bugs.webkit.org/show_bug.cgi?id=152956
+
+        Reviewed by Ryosuke Niwa.
+        
+        Enable displaylists tests on Mac and iOS.
+
+        * TestExpectations:
+        * displaylists/layer-dispay-list-expected.txt: Added.
+        * displaylists/layer-dispay-list.html: Added.
+        * platform/ios-simulator/TestExpectations:
+        * platform/mac/TestExpectations:
+
</ins><span class="cx"> 2016-01-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         createElementNS and createAttributeNS should treat undefined namespaceURI as null string
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/LayoutTests/TestExpectations        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx"> accessibility/gtk [ Skip ]
</span><span class="cx"> accessibility/mac [ Skip ]
</span><span class="cx"> accessibility/win [ Skip ]
</span><ins>+displaylists [ Skip ]
</ins><span class="cx"> editing/mac [ Skip ]
</span><span class="cx"> editing/pasteboard/gtk [ Skip ]
</span><span class="cx"> tiled-drawing [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsdisplaylistslayerdispaylistexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt (0 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt                                (rev 0)
+++ trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+
+(
+  (translate
+    (x 0.00)
+    (y 0.00)))
+(
+  (fill-rect-with-color
+    (extent at (0,0) size 104x104)
+    (rect at (0,0) size 104x104)
+    (color #008000)))
+(
+  (set-state
+    (change-flags 131456)
+    (fill-color #0000FF)
+    (stroke-style 0)
+    (should-antialias 0)))
+(
+  (draw-rect
+    (extent at (0,0) size 104x2)
+    (rect at (0,0) size 104x2)
+    (border-thickness 1.00)))
+(
+  (draw-rect
+    (extent at (0,102) size 104x2)
+    (rect at (0,102) size 104x2)
+    (border-thickness 1.00)))
+(
+  (draw-rect
+    (extent at (0,0) size 2x104)
+    (rect at (0,0) size 2x104)
+    (border-thickness 1.00)))
+(
+  (draw-rect
+    (extent at (102,0) size 2x104)
+    (rect at (102,0) size 2x104)
+    (border-thickness 1.00)))
</ins></span></pre></div>
<a id="trunkLayoutTestsdisplaylistslayerdispaylisthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/displaylists/layer-dispay-list.html (0 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/displaylists/layer-dispay-list.html                                (rev 0)
+++ trunk/LayoutTests/displaylists/layer-dispay-list.html        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        .box {
+            width: 100px;
+            height: 100px;
+            background-color: green;
+            border: 2px solid blue;
+        }
+        
+        .composited {
+            -webkit-transform: translateZ(0);
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        var targetDiv;
+        function doTest()
+        {
+            // document.body.offsetWidth;
+            targetDiv = document.getElementById('target');
+            if (window.internals)
+                internals.setElementUsesDisplayListDrawing(targetDiv, true);
+            
+            window.setTimeout(function() {
+                if (window.internals) {
+                    var displayList = internals.displayListForElement(targetDiv);
+                    document.getElementById('output').textContent = displayList;
+                }
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0);
+        }
+        window.addEventListener('load', doTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;target&quot; class=&quot;composited box&quot;&gt;
+&lt;/div&gt;
+&lt;pre id=&quot;output&quot;&gt;&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx"> #//////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> 
</span><span class="cx"> accessibility/ios-simulator [ Pass ]
</span><ins>+displaylists [ Pass ]
</ins><span class="cx"> quicklook [ Pass ]
</span><span class="cx"> http/tests/quicklook [ Pass ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx"> #//////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> 
</span><span class="cx"> accessibility/mac [ Pass ]
</span><ins>+displaylists [ Pass ]
</ins><span class="cx"> editing/mac [ Pass ]
</span><span class="cx"> fast/scrolling/latching [ Pass ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/ChangeLog        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-01-10  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Make a way to test display-list drawing
+        https://bugs.webkit.org/show_bug.cgi?id=152956
+
+        Reviewed by Ryosuke Niwa.
+
+        Make it possible to toggle display-list drawing for a given compositing
+        layer via internals, as well as getting a textual representation of the display
+        list, optionally including items with platform-specific behavior.
+        
+        Add one test that uses this.
+
+        Test: displaylists/layer-dispay-list.html
+
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::displayListAsText):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::displayListAsText):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/displaylists/DisplayList.cpp:
+        (WebCore::DisplayList::DisplayList::shouldDumpForFlags):
+        (WebCore::DisplayList::DisplayList::asText):
+        * platform/graphics/displaylists/DisplayList.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::setUsesDisplayListDrawing):
+        (WebCore::RenderLayerBacking::displayListAsText):
+        * rendering/RenderLayerBacking.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setElementUsesDisplayListDrawing):
+        (WebCore::Internals::displayListForElement):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-01-15  Olivier Blin  &lt;olivier.blin@softathome.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix audio build with video disabled
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -54,6 +54,10 @@
</span><span class="cx"> class TimingFunction;
</span><span class="cx"> class TransformationMatrix;
</span><span class="cx"> 
</span><ins>+namespace DisplayList {
+typedef unsigned AsTextFlags;
+}
+
</ins><span class="cx"> // Base class for animation values (also used for transitions). Here to
</span><span class="cx"> // represent values for properties being animated via the GraphicsLayer,
</span><span class="cx"> // without pulling in style-related data from outside of the platform directory.
</span><span class="lines">@@ -517,6 +521,9 @@
</span><span class="cx">     // pointers for the layers and timing data will be included in the returned string.
</span><span class="cx">     WEBCORE_EXPORT String layerTreeAsText(LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
</span><span class="cx"> 
</span><ins>+    // For testing.
+    WEBCORE_EXPORT virtual String displayListAsText(DisplayList::AsTextFlags) const { return String(); }
+
</ins><span class="cx">     // Return an estimate of the backing store memory cost (in bytes). May be incorrect for tiled layers.
</span><span class="cx">     WEBCORE_EXPORT virtual double backingStoreMemoryEstimate() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -3270,6 +3270,14 @@
</span><span class="cx">     noteLayerPropertyChanged(DebugIndicatorsChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String GraphicsLayerCA::displayListAsText(DisplayList::AsTextFlags flags) const
+{
+    if (!m_displayList)
+        return String();
+
+    return m_displayList-&gt;asText(flags);
+}
+
</ins><span class="cx"> void GraphicsLayerCA::setDebugBackgroundColor(const Color&amp; color)
</span><span class="cx"> {    
</span><span class="cx">     if (color.isValid())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -208,6 +208,8 @@
</span><span class="cx">     WEBCORE_EXPORT virtual void setIsViewportConstrained(bool) override;
</span><span class="cx">     virtual bool isViewportConstrained() const override { return m_isViewportConstrained; }
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT virtual String displayListAsText(DisplayList::AsTextFlags) const override;
+
</ins><span class="cx">     WEBCORE_EXPORT virtual double backingStoreMemoryEstimate() const override;
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT virtual bool shouldRepaintOnSizeChange() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -58,6 +58,51 @@
</span><span class="cx">     m_list.resize(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool DisplayList::shouldDumpForFlags(AsTextFlags flags, const Item&amp; item)
+{
+    switch (item.type()) {
+    case ItemType::SetState:
+        if (!(flags &amp; AsTextFlag::IncludesPlatformOperations)) {
+            const auto&amp; stateItem = downcast&lt;SetState&gt;(item);
+            // FIXME: for now, only drop the item if the only state-change flags are platform-specific.
+            if (stateItem.state().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange)
+                return false;
+
+            if (stateItem.state().m_changeFlags == GraphicsContextState::AntialiasedFontDilationEnabledChange)
+                return false;
+
+            if (stateItem.state().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange)
+                return false;
+        }
+        break;
+#if USE(CG)
+    case ItemType::ApplyFillPattern:
+    case ItemType::ApplyStrokePattern:
+        if (!(flags &amp; AsTextFlag::IncludesPlatformOperations))
+            return false;
+        break;
+#endif
+    default:
+        break;
+    }
+    return true;
+}
+
+String DisplayList::asText(AsTextFlags flags) const
+{
+    TextStream stream;
+    size_t numItems = m_list.size();
+    for (size_t i = 0; i &lt; numItems; ++i) {
+        const auto&amp; item = m_list[i].get();
+        if (!shouldDumpForFlags(flags, item))
+            continue;
+
+        TextStream::GroupScope scope(stream);
+        stream &lt;&lt; item;
+    }
+    return stream.release();
+}
+
</ins><span class="cx"> void DisplayList::dump(TextStream&amp; ts) const
</span><span class="cx"> {
</span><span class="cx">     TextStream::GroupScope group(ts);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -41,6 +41,13 @@
</span><span class="cx"> 
</span><span class="cx"> class Item;
</span><span class="cx"> 
</span><ins>+enum AsTextFlag {
+    None                            = 0,
+    IncludesPlatformOperations      = 1 &lt;&lt; 0,
+};
+
+typedef unsigned AsTextFlags;
+
</ins><span class="cx"> class DisplayList {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(DisplayList);
</span><span class="cx">     friend class Recorder;
</span><span class="lines">@@ -64,6 +71,8 @@
</span><span class="cx"> 
</span><span class="cx">     size_t itemCount() const { return m_list.size(); }
</span><span class="cx">     size_t sizeInBytes() const;
</span><ins>+    
+    String asText(AsTextFlags) const;
</ins><span class="cx"> 
</span><span class="cx"> #if !defined(NDEBUG) || !LOG_DISABLED
</span><span class="cx">     WTF::CString description() const;
</span><span class="lines">@@ -77,6 +86,8 @@
</span><span class="cx">         return m_list.last().get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static bool shouldDumpForFlags(AsTextFlags, const Item&amp;);
+
</ins><span class="cx">     Vector&lt;Ref&lt;Item&gt;&gt;&amp; list() { return m_list; }
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;Ref&lt;Item&gt;&gt; m_list;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -182,6 +182,22 @@
</span><span class="cx">     return graphicsLayer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderLayerBacking::setUsesDisplayListDrawing(bool usesDisplayListDrawing)
+{
+    // Note that this only affects the primary layer.
+    if (usesDisplayListDrawing == m_graphicsLayer-&gt;usesDisplayListDrawing())
+        return;
+
+    m_graphicsLayer-&gt;setUsesDisplayListDrawing(usesDisplayListDrawing);
+    if (m_graphicsLayer-&gt;drawsContent())
+        m_graphicsLayer-&gt;setNeedsDisplay();
+}
+
+String RenderLayerBacking::displayListAsText(DisplayList::AsTextFlags flags) const
+{
+    return m_graphicsLayer-&gt;displayListAsText(flags);
+}
+
</ins><span class="cx"> void RenderLayerBacking::tiledBackingUsageChanged(const GraphicsLayer* layer, bool usingTiledBacking)
</span><span class="cx"> {
</span><span class="cx">     compositor().layerTiledBackingUsageChanged(layer, usingTiledBacking);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -240,6 +240,10 @@
</span><span class="cx"> 
</span><span class="cx">     // Return an estimate of the backing store area (in pixels) allocated by this object's GraphicsLayers.
</span><span class="cx">     WEBCORE_EXPORT double backingStoreMemoryEstimate() const;
</span><ins>+    
+    // For testing only.
+    WEBCORE_EXPORT void setUsesDisplayListDrawing(bool);
+    WEBCORE_EXPORT String displayListAsText(DisplayList::AsTextFlags) const;
</ins><span class="cx"> 
</span><span class="cx">     LayoutSize devicePixelFractionFromRenderer() const { return m_devicePixelFractionFromRenderer; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include &quot;DOMPath.h&quot;
</span><span class="cx"> #include &quot;DOMStringList.h&quot;
</span><span class="cx"> #include &quot;DOMWindow.h&quot;
</span><ins>+#include &quot;DisplayList.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentMarker.h&quot;
</span><span class="cx"> #include &quot;DocumentMarkerController.h&quot;
</span><span class="lines">@@ -94,6 +95,7 @@
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><span class="cx"> #include &quot;Range.h&quot;
</span><span class="cx"> #include &quot;RenderEmbeddedObject.h&quot;
</span><ins>+#include &quot;RenderLayerBacking.h&quot;
</ins><span class="cx"> #include &quot;RenderLayerCompositor.h&quot;
</span><span class="cx"> #include &quot;RenderMenuList.h&quot;
</span><span class="cx"> #include &quot;RenderTreeAsText.h&quot;
</span><span class="lines">@@ -1973,6 +1975,59 @@
</span><span class="cx">     return page-&gt;nonFastScrollableRects();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Internals::setElementUsesDisplayListDrawing(Element* element, bool usesDisplayListDrawing, ExceptionCode&amp; ec)
+{
+    Document* document = contextDocument();
+    if (!document || !document-&gt;renderView()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    if (!element || !element-&gt;renderer() || !element-&gt;renderer()-&gt;hasLayer()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    RenderLayer* layer = downcast&lt;RenderLayerModelObject&gt;(element-&gt;renderer())-&gt;layer();
+    if (!layer-&gt;isComposited()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+    
+    layer-&gt;backing()-&gt;setUsesDisplayListDrawing(usesDisplayListDrawing);
+}
+
+String Internals::displayListForElement(Element* element, ExceptionCode&amp; ec)
+{
+    return displayListForElement(element, 0, ec);
+}
+
+String Internals::displayListForElement(Element* element, unsigned flags, ExceptionCode&amp; ec)
+{
+    Document* document = contextDocument();
+    if (!document || !document-&gt;renderView()) {
+        ec = INVALID_ACCESS_ERR;
+        return String();
+    }
+
+    if (!element || !element-&gt;renderer() || !element-&gt;renderer()-&gt;hasLayer()) {
+        ec = INVALID_ACCESS_ERR;
+        return String();
+    }
+    
+    RenderLayer* layer = downcast&lt;RenderLayerModelObject&gt;(element-&gt;renderer())-&gt;layer();
+    if (!layer-&gt;isComposited()) {
+        ec = INVALID_ACCESS_ERR;
+        return String();
+    }
+
+    DisplayList::AsTextFlags displayListFlags = 0;
+    if (flags &amp; DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS)
+        displayListFlags |= DisplayList::AsTextFlag::IncludesPlatformOperations;
+    
+    return layer-&gt;backing()-&gt;displayListAsText(displayListFlags);
+}
+
</ins><span class="cx"> void Internals::garbageCollectDocumentResources(ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><span class="cx">     Document* document = contextDocument();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/testing/Internals.h        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -253,6 +253,15 @@
</span><span class="cx">     String mainThreadScrollingReasons(ExceptionCode&amp;) const;
</span><span class="cx">     RefPtr&lt;ClientRectList&gt; nonFastScrollableRects(ExceptionCode&amp;) const;
</span><span class="cx"> 
</span><ins>+    void setElementUsesDisplayListDrawing(Element*, bool usesDisplayListDrawing, ExceptionCode&amp;);
+
+    enum {
+        // Values need to be kept in sync with Internals.idl.
+        DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1,
+    };
+    String displayListForElement(Element*, unsigned flags, ExceptionCode&amp;);
+    String displayListForElement(Element*, ExceptionCode&amp;);
+
</ins><span class="cx">     void garbageCollectDocumentResources(ExceptionCode&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     void allowRoundingHacks() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (195155 => 195156)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-01-15 23:42:04 UTC (rev 195155)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-01-15 23:57:41 UTC (rev 195156)
</span><span class="lines">@@ -224,6 +224,13 @@
</span><span class="cx"> 
</span><span class="cx">     [RaisesException] DOMString repaintRectsAsText();
</span><span class="cx"> 
</span><ins>+    // These throw if the element does not have a compositing layer.
+    [RaisesException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
+
+    // Flags for displayListForElement.
+    const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
+    [RaisesException] DOMString displayListForElement(Element element, optional unsigned short flags);
+
</ins><span class="cx">     [RaisesException] void garbageCollectDocumentResources();
</span><span class="cx"> 
</span><span class="cx">     void allowRoundingHacks();
</span></span></pre>
</div>
</div>

</body>
</html>