<!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>[225220] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225220">225220</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2017-11-28 09:39:17 -0800 (Tue, 28 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modernize GraphicsLayer dumping
https://bugs.webkit.org/show_bug.cgi?id=180067

Reviewed by Sam Weinig.
Source/WebCore:

Use the indent stream manipulator, and TextStream's built-in indent amount
for GraphicsLayer dumping.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpLayer const):
(WebCore::dumpChildren):
(WebCore::GraphicsLayer::dumpProperties const):
(WebCore::GraphicsLayer::layerTreeAsText const):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::dumpAdditionalProperties const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::dumpInnerLayer):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties const):
* platform/graphics/ca/GraphicsLayerCA.h:

Source/WTF:

Expose the current indent.

* wtf/text/TextStream.h:
(WTF::TextStream::indent const):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextTextStreamh">trunk/Source/WTF/wtf/text/TextStream.h</a></li>
<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="#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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WTF/ChangeLog  2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-11-28  Simon Fraser  <simon.fraser@apple.com>
+
+        Modernize GraphicsLayer dumping
+        https://bugs.webkit.org/show_bug.cgi?id=180067
+
+        Reviewed by Sam Weinig.
+        
+        Expose the current indent.
+
+        * wtf/text/TextStream.h:
+        (WTF::TextStream::indent const):
+
</ins><span class="cx"> 2017-11-27  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Move callOnMainThreadAndWait() from SocketStreamHandleImplCFNet.cpp to MainThread.h
</span></span></pre></div>
<a id="trunkSourceWTFwtftextTextStreamh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/TextStream.h (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/TextStream.h   2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WTF/wtf/text/TextStream.h      2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -90,6 +90,7 @@
</span><span class="cx">     WTF_EXPORT_PRIVATE void endGroup();
</span><span class="cx">     WTF_EXPORT_PRIVATE void nextLine(); // Output newline and indent.
</span><span class="cx"> 
</span><ins>+    int indent() const { return m_indent; }
</ins><span class="cx">     void increaseIndent(int amount = 1) { m_indent += amount; }
</span><span class="cx">     void decreaseIndent(int amount = 1) { m_indent -= amount; ASSERT(m_indent >= 0); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WebCore/ChangeLog      2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2017-11-28  Simon Fraser  <simon.fraser@apple.com>
+
+        Modernize GraphicsLayer dumping
+        https://bugs.webkit.org/show_bug.cgi?id=180067
+
+        Reviewed by Sam Weinig.
+
+        Use the indent stream manipulator, and TextStream's built-in indent amount
+        for GraphicsLayer dumping.
+
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::dumpLayer const):
+        (WebCore::dumpChildren):
+        (WebCore::GraphicsLayer::dumpProperties const):
+        (WebCore::GraphicsLayer::layerTreeAsText const):
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::dumpAdditionalProperties const):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::dumpInnerLayer):
+        (WebCore::GraphicsLayerCA::dumpAdditionalProperties const):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+
</ins><span class="cx"> 2017-11-28  Antoine Quint  <graouts@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove dead debugging code in modern media controls
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp    2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -686,10 +686,9 @@
</span><span class="cx">         traverse(*maskLayer, traversalFunc);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
</del><ins>+void GraphicsLayer::dumpLayer(TextStream& ts, LayerTreeAsTextBehavior behavior) const
</ins><span class="cx"> {
</span><del>-    writeIndent(ts, indent);
-    ts << "(" << "GraphicsLayer";
</del><ins>+    ts << indent << "(" << "GraphicsLayer";
</ins><span class="cx"> 
</span><span class="cx">     if (behavior & LayerTreeAsTextDebug) {
</span><span class="cx">         ts << " " << static_cast<void*>(const_cast<GraphicsLayer*>(this));
</span><span class="lines">@@ -697,128 +696,93 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ts << "\n";
</span><del>-    dumpProperties(ts, indent, behavior);
-    writeIndent(ts, indent);
-    ts << ")\n";
</del><ins>+    dumpProperties(ts, behavior);
+    ts << indent << ")\n";
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void dumpChildren(TextStream& ts, const Vector<GraphicsLayer*>& children, unsigned& totalChildCount, int indent, LayerTreeAsTextBehavior behavior)
</del><ins>+static void dumpChildren(TextStream& ts, const Vector<GraphicsLayer*>& children, unsigned& totalChildCount, LayerTreeAsTextBehavior behavior)
</ins><span class="cx"> {
</span><span class="cx">     totalChildCount += children.size();
</span><span class="cx">     for (auto* child : children) {
</span><span class="cx">         if ((behavior & LayerTreeAsTextDebug) || !child->client().shouldSkipLayerInDump(child, behavior)) {
</span><del>-            child->dumpLayer(ts, indent + 2, behavior);
</del><ins>+            TextStream::IndentScope indentScope(ts);
+            child->dumpLayer(ts, behavior);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         totalChildCount--;
</span><del>-        dumpChildren(ts, child->children(), totalChildCount, indent, behavior);
</del><ins>+        dumpChildren(ts, child->children(), totalChildCount, behavior);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
</del><ins>+void GraphicsLayer::dumpProperties(TextStream& ts, LayerTreeAsTextBehavior behavior) const
</ins><span class="cx"> {
</span><del>-    if (m_position != FloatPoint()) {
-        writeIndent(ts, indent + 1);
-        ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
-    }
</del><ins>+    TextStream::IndentScope indentScope(ts);
+    if (m_position != FloatPoint())
+        ts << indent << "(position " << m_position.x() << " " << m_position.y() << ")\n";
</ins><span class="cx"> 
</span><del>-    if (m_approximatePosition) {
-        writeIndent(ts, indent + 1);
-        ts << "(approximate position " << m_approximatePosition.value().x() << " " << m_approximatePosition.value().y() << ")\n";
-    }
</del><ins>+    if (m_approximatePosition)
+        ts << indent << "(approximate position " << m_approximatePosition.value().x() << " " << m_approximatePosition.value().y() << ")\n";
</ins><span class="cx"> 
</span><del>-    if (m_boundsOrigin != FloatPoint()) {
-        writeIndent(ts, indent + 1);
-        ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n";
-    }
</del><ins>+    if (m_boundsOrigin != FloatPoint())
+        ts << indent << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n";
</ins><span class="cx"> 
</span><span class="cx">     if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y();
</del><ins>+        ts << indent << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y();
</ins><span class="cx">         if (m_anchorPoint.z())
</span><span class="cx">             ts << " " << m_anchorPoint.z();
</span><span class="cx">         ts << ")\n";
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_size != IntSize()) {
-        writeIndent(ts, indent + 1);
-        ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
-    }
</del><ins>+    if (m_size != IntSize())
+        ts << indent << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
</ins><span class="cx"> 
</span><del>-    if (m_opacity != 1) {
-        writeIndent(ts, indent + 1);
-        ts << "(opacity " << m_opacity << ")\n";
-    }
</del><ins>+    if (m_opacity != 1)
+        ts << indent << "(opacity " << m_opacity << ")\n";
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><del>-    if (m_blendMode != BlendModeNormal) {
-        writeIndent(ts, indent + 1);
-        ts << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blendMode) << ")\n";
-    }
</del><ins>+    if (m_blendMode != BlendModeNormal)
+        ts << indent << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blendMode) << ")\n";
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (type() == Type::Normal && tiledBacking()) {
-        writeIndent(ts, indent + 1);
-        ts << "(usingTiledLayer 1)\n";
-    }
</del><ins>+    if (type() == Type::Normal && tiledBacking())
+        ts << indent << "(usingTiledLayer 1)\n";
</ins><span class="cx"> 
</span><span class="cx">     bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack = m_client.needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(*this);
</span><del>-    if (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) {
-        writeIndent(ts, indent + 1);
-        ts << "(contentsOpaque " << (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) << ")\n";
-    }
</del><ins>+    if (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack)
+        ts << indent << "(contentsOpaque " << (m_contentsOpaque || needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack) << ")\n";
</ins><span class="cx"> 
</span><del>-    if (m_supportsSubpixelAntialiasedText) {
-        writeIndent(ts, indent + 1);
-        ts << "(supports subpixel antialiased text " << m_supportsSubpixelAntialiasedText << ")\n";
-    }
</del><ins>+    if (m_supportsSubpixelAntialiasedText)
+        ts << indent << "(supports subpixel antialiased text " << m_supportsSubpixelAntialiasedText << ")\n";
</ins><span class="cx"> 
</span><del>-    if (m_preserves3D) {
-        writeIndent(ts, indent + 1);
-        ts << "(preserves3D " << m_preserves3D << ")\n";
-    }
</del><ins>+    if (m_preserves3D)
+        ts << indent << "(preserves3D " << m_preserves3D << ")\n";
</ins><span class="cx"> 
</span><del>-    if (m_drawsContent && m_client.shouldDumpPropertyForLayer(this, "drawsContent")) {
-        writeIndent(ts, indent + 1);
-        ts << "(drawsContent " << m_drawsContent << ")\n";
-    }
</del><ins>+    if (m_drawsContent && m_client.shouldDumpPropertyForLayer(this, "drawsContent"))
+        ts << indent << "(drawsContent " << m_drawsContent << ")\n";
</ins><span class="cx"> 
</span><del>-    if (!m_contentsVisible) {
-        writeIndent(ts, indent + 1);
-        ts << "(contentsVisible " << m_contentsVisible << ")\n";
-    }
</del><ins>+    if (!m_contentsVisible)
+        ts << indent << "(contentsVisible " << m_contentsVisible << ")\n";
</ins><span class="cx"> 
</span><del>-    if (!m_backfaceVisibility) {
-        writeIndent(ts, indent + 1);
-        ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
-    }
</del><ins>+    if (!m_backfaceVisibility)
+        ts << indent << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
</ins><span class="cx"> 
</span><span class="cx">     if (behavior & LayerTreeAsTextDebug) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(primary-layer-id " << primaryLayerID() << ")\n";
-        writeIndent(ts, indent + 1);
-        ts << "(client " << static_cast<void*>(&m_client) << ")\n";
</del><ins>+        ts << indent << "(primary-layer-id " << primaryLayerID() << ")\n";
+        ts << indent << "(client " << static_cast<void*>(&m_client) << ")\n";
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_backgroundColor.isValid() && m_client.shouldDumpPropertyForLayer(this, "backgroundColor")) {
-        writeIndent(ts, indent + 1);
-        ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n";
-    }
</del><ins>+    if (m_backgroundColor.isValid() && m_client.shouldDumpPropertyForLayer(this, "backgroundColor"))
+        ts << indent << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n";
</ins><span class="cx"> 
</span><del>-    if (behavior & LayerTreeAsTextIncludeAcceleratesDrawing && m_acceleratesDrawing) {
-        writeIndent(ts, indent + 1);
-        ts << "(acceleratesDrawing " << m_acceleratesDrawing << ")\n";
-    }
</del><ins>+    if (behavior & LayerTreeAsTextIncludeAcceleratesDrawing && m_acceleratesDrawing)
+        ts << indent << "(acceleratesDrawing " << m_acceleratesDrawing << ")\n";
</ins><span class="cx"> 
</span><del>-    if (behavior & LayerTreeAsTextIncludeBackingStoreAttached) {
-        writeIndent(ts, indent + 1);
-        ts << "(backingStoreAttached " << backingStoreAttached() << ")\n";
-    }
</del><ins>+    if (behavior & LayerTreeAsTextIncludeBackingStoreAttached)
+        ts << indent << "(backingStoreAttached " << backingStoreAttached() << ")\n";
</ins><span class="cx"> 
</span><span class="cx">     if (!m_transform.isIdentity()) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(transform ";
</del><ins>+        ts << indent << "(transform ";
</ins><span class="cx">         ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] ";
</span><span class="cx">         ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] ";
</span><span class="cx">         ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] ";
</span><span class="lines">@@ -828,8 +792,7 @@
</span><span class="cx">     // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior
</span><span class="cx">     // differs between platforms.
</span><span class="cx">     if (parent() && !m_childrenTransform.isIdentity()) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(childrenTransform ";
</del><ins>+        ts << indent << "(childrenTransform ";
</ins><span class="cx">         ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] ";
</span><span class="cx">         ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] ";
</span><span class="cx">         ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] ";
</span><span class="lines">@@ -837,26 +800,27 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_maskLayer) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(mask layer";
</del><ins>+        ts << indent << "(mask layer";
</ins><span class="cx">         if (behavior & LayerTreeAsTextDebug)
</span><span class="cx">             ts << " " << m_maskLayer;
</span><span class="cx">         ts << ")\n";
</span><del>-        m_maskLayer->dumpLayer(ts, indent + 2, behavior);
</del><ins>+
+        TextStream::IndentScope indentScope(ts);
+        m_maskLayer->dumpLayer(ts, behavior);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_replicaLayer) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(replica layer";
</del><ins>+        ts << indent << "(replica layer";
</ins><span class="cx">         if (behavior & LayerTreeAsTextDebug)
</span><span class="cx">             ts << " " << m_replicaLayer;
</span><span class="cx">         ts << ")\n";
</span><del>-        m_replicaLayer->dumpLayer(ts, indent + 2, behavior);
</del><ins>+
+        TextStream::IndentScope indentScope(ts);
+        m_replicaLayer->dumpLayer(ts, behavior);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_replicatedLayer) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(replicated layer";
</del><ins>+        ts << indent << "(replicated layer";
</ins><span class="cx">         if (behavior & LayerTreeAsTextDebug)
</span><span class="cx">             ts << " " << m_replicatedLayer;
</span><span class="cx">         ts << ")\n";
</span><span class="lines">@@ -863,13 +827,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (behavior & LayerTreeAsTextIncludeRepaintRects && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty() && m_client.shouldDumpPropertyForLayer(this, "repaintRects")) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(repaint rects\n";
</del><ins>+        ts << indent << "(repaint rects\n";
</ins><span class="cx">         for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) {
</span><span class="cx">             if (repaintRectMap().get(this)[i].isEmpty())
</span><span class="cx">                 continue;
</span><del>-            writeIndent(ts, indent + 2);
-            ts << "(rect ";
</del><ins>+
+            TextStream::IndentScope indentScope(ts);
+            ts << indent << "(rect ";
</ins><span class="cx">             ts << repaintRectMap().get(this)[i].x() << " ";
</span><span class="cx">             ts << repaintRectMap().get(this)[i].y() << " ";
</span><span class="cx">             ts << repaintRectMap().get(this)[i].width() << " ";
</span><span class="lines">@@ -876,56 +840,46 @@
</span><span class="cx">             ts << repaintRectMap().get(this)[i].height();
</span><span class="cx">             ts << ")\n";
</span><span class="cx">         }
</span><del>-        writeIndent(ts, indent + 1);
-        ts << ")\n";
</del><ins>+        ts << indent << ")\n";
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (behavior & LayerTreeAsTextIncludePaintingPhases && paintingPhase()) {
</span><del>-        writeIndent(ts, indent + 1);
-        ts << "(paintingPhases\n";
-        if (paintingPhase() & GraphicsLayerPaintBackground) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintBackground\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintForeground) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintForeground\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintMask) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintMask\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintChildClippingMask) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintChildClippingMask\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintOverflowContents) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintOverflowContents\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintCompositedScroll) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintCompositedScroll\n";
-        }
-        writeIndent(ts, indent + 1);
-        ts << ")\n";
</del><ins>+        ts << indent << "(paintingPhases\n";
+        TextStream::IndentScope indentScope(ts);
+        if (paintingPhase() & GraphicsLayerPaintBackground)
+            ts << indent << "GraphicsLayerPaintBackground\n";
+
+        if (paintingPhase() & GraphicsLayerPaintForeground)
+            ts << indent << "GraphicsLayerPaintForeground\n";
+
+        if (paintingPhase() & GraphicsLayerPaintMask)
+            ts << indent << "GraphicsLayerPaintMask\n";
+
+        if (paintingPhase() & GraphicsLayerPaintChildClippingMask)
+            ts << indent << "GraphicsLayerPaintChildClippingMask\n";
+
+        if (paintingPhase() & GraphicsLayerPaintOverflowContents)
+            ts << indent << "GraphicsLayerPaintOverflowContents\n";
+
+        if (paintingPhase() & GraphicsLayerPaintCompositedScroll)
+            ts << indent << "GraphicsLayerPaintCompositedScroll\n";
+
+        ts << indent << ")\n";
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    dumpAdditionalProperties(ts, indent, behavior);
</del><ins>+    dumpAdditionalProperties(ts, behavior);
</ins><span class="cx">     
</span><span class="cx">     if (m_children.size()) {
</span><span class="cx">         TextStream childrenStream;
</span><del>-
</del><ins>+        
+        childrenStream.increaseIndent(ts.indent());
</ins><span class="cx">         unsigned totalChildCount = 0;
</span><del>-        dumpChildren(childrenStream, m_children, totalChildCount, indent, behavior);
</del><ins>+        dumpChildren(childrenStream, m_children, totalChildCount, behavior);
</ins><span class="cx"> 
</span><del>-        writeIndent(childrenStream, indent + 1);
-        childrenStream << ")\n";
-
</del><span class="cx">         if (totalChildCount) {
</span><del>-            writeIndent(ts, indent + 1);
-            ts << "(children " << totalChildCount << "\n";
</del><ins>+            ts << indent << "(children " << totalChildCount << "\n";
</ins><span class="cx">             ts << childrenStream.release();
</span><ins>+            ts << indent << ")\n";
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -957,7 +911,7 @@
</span><span class="cx"> {
</span><span class="cx">     TextStream ts(TextStream::LineMode::MultipleLine, TextStream::Formatting::SVGStyleRect);
</span><span class="cx"> 
</span><del>-    dumpLayer(ts, 0, behavior);
</del><ins>+    dumpLayer(ts, behavior);
</ins><span class="cx">     return ts.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h   2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h      2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx">     virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; }
</span><span class="cx">     CompositingCoordinatesOrientation contentsOrientation() const { return m_contentsOrientation; }
</span><span class="cx"> 
</span><del>-    void dumpLayer(WTF::TextStream&, int indent = 0, LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
</del><ins>+    void dumpLayer(WTF::TextStream&, LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setShowDebugBorder(bool show) { m_showDebugBorder = show; }
</span><span class="cx">     bool isShowingDebugBorder() const { return m_showDebugBorder; }
</span><span class="lines">@@ -609,8 +609,8 @@
</span><span class="cx">     GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
</span><span class="cx">     virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
</span><span class="cx"> 
</span><del>-    void dumpProperties(WTF::TextStream&, int indent, LayerTreeAsTextBehavior) const;
-    virtual void dumpAdditionalProperties(WTF::TextStream&, int /*indent*/, LayerTreeAsTextBehavior) const { }
</del><ins>+    void dumpProperties(WTF::TextStream&, LayerTreeAsTextBehavior) const;
+    virtual void dumpAdditionalProperties(WTF::TextStream&, LayerTreeAsTextBehavior) const { }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT virtual void getDebugBorderInfo(Color&, float& width) 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 (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp    2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp       2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -3570,80 +3570,62 @@
</span><span class="cx">     GraphicsLayer::getDebugBorderInfo(color, width);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void dumpInnerLayer(TextStream& textStream, String label, PlatformCALayer* layer, int indent, LayerTreeAsTextBehavior behavior)
</del><ins>+static void dumpInnerLayer(TextStream& textStream, String label, PlatformCALayer* layer, LayerTreeAsTextBehavior behavior)
</ins><span class="cx"> {
</span><span class="cx">     if (!layer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    writeIndent(textStream, indent + 1);
-    textStream << "(" << label << " ";
</del><ins>+    textStream << indent << "(" << label << " ";
</ins><span class="cx">     if (behavior & LayerTreeAsTextDebug)
</span><span class="cx">         textStream << "id=" << layer->layerID() << " ";
</span><del>-    textStream << layer->position().x() << ", " << layer->position().y()
-        << " " << layer->bounds().width() << " x " << layer->bounds().height();
</del><ins>+    textStream << layer->position().x() << ", " << layer->position().y() << " " << layer->bounds().width() << " x " << layer->bounds().height();
</ins><span class="cx">     if (layer->isHidden())
</span><span class="cx">         textStream << " hidden";
</span><span class="cx">     textStream << ")\n";
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerCA::dumpAdditionalProperties(TextStream& textStream, int indent, LayerTreeAsTextBehavior behavior) const
</del><ins>+void GraphicsLayerCA::dumpAdditionalProperties(TextStream& textStream, LayerTreeAsTextBehavior behavior) const
</ins><span class="cx"> {
</span><span class="cx">     if (behavior & LayerTreeAsTextIncludeVisibleRects) {
</span><del>-        writeIndent(textStream, indent + 1);
-        textStream << "(visible rect " << m_visibleRect.x() << ", " << m_visibleRect.y() << " " << m_visibleRect.width() << " x " << m_visibleRect.height() << ")\n";
-
-        writeIndent(textStream, indent + 1);
-        textStream << "(coverage rect " << m_coverageRect.x() << ", " << m_coverageRect.y() << " " << m_coverageRect.width() << " x " << m_coverageRect.height() << ")\n";
-
-        writeIndent(textStream, indent + 1);
-        textStream << "(intersects coverage rect " << m_intersectsCoverageRect << ")\n";
-
-        writeIndent(textStream, indent + 1);
-        textStream << "(contentsScale " << m_layer->contentsScale() << ")\n";
</del><ins>+        textStream << indent << "(visible rect " << m_visibleRect.x() << ", " << m_visibleRect.y() << " " << m_visibleRect.width() << " x " << m_visibleRect.height() << ")\n";
+        textStream << indent << "(coverage rect " << m_coverageRect.x() << ", " << m_coverageRect.y() << " " << m_coverageRect.width() << " x " << m_coverageRect.height() << ")\n";
+        textStream << indent << "(intersects coverage rect " << m_intersectsCoverageRect << ")\n";
+        textStream << indent << "(contentsScale " << m_layer->contentsScale() << ")\n";
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (tiledBacking() && (behavior & LayerTreeAsTextIncludeTileCaches)) {
</span><del>-        if (behavior & LayerTreeAsTextDebug) {
-            writeIndent(textStream, indent + 1);
-            textStream << "(tiled backing " << tiledBacking() << ")\n";
-        }
</del><ins>+        if (behavior & LayerTreeAsTextDebug)
+            textStream << indent << "(tiled backing " << tiledBacking() << ")\n";
</ins><span class="cx"> 
</span><span class="cx">         IntRect tileCoverageRect = tiledBacking()->tileCoverageRect();
</span><del>-        writeIndent(textStream, indent + 1);
-        textStream << "(tile cache coverage " << tileCoverageRect.x() << ", " << tileCoverageRect.y() << " " << tileCoverageRect.width() << " x " << tileCoverageRect.height() << ")\n";
</del><ins>+        textStream << indent << "(tile cache coverage " << tileCoverageRect.x() << ", " << tileCoverageRect.y() << " " << tileCoverageRect.width() << " x " << tileCoverageRect.height() << ")\n";
</ins><span class="cx"> 
</span><span class="cx">         IntSize tileSize = tiledBacking()->tileSize();
</span><del>-        writeIndent(textStream, indent + 1);
-        textStream << "(tile size " << tileSize.width() << " x " << tileSize.height() << ")\n";
</del><ins>+        textStream << indent << "(tile size " << tileSize.width() << " x " << tileSize.height() << ")\n";
</ins><span class="cx">         
</span><span class="cx">         IntRect gridExtent = tiledBacking()->tileGridExtent();
</span><del>-        writeIndent(textStream, indent + 1);
-        textStream << "(top left tile " << gridExtent.x() << ", " << gridExtent.y() << " tiles grid " << gridExtent.width() << " x " << gridExtent.height() << ")\n";
</del><ins>+        textStream << indent << "(top left tile " << gridExtent.x() << ", " << gridExtent.y() << " tiles grid " << gridExtent.width() << " x " << gridExtent.height() << ")\n";
</ins><span class="cx"> 
</span><del>-        writeIndent(textStream, indent + 1);
-        textStream << "(in window " << tiledBacking()->isInWindow() << ")\n";
</del><ins>+        textStream << indent << "(in window " << tiledBacking()->isInWindow() << ")\n";
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (m_layer->wantsDeepColorBackingStore()) {
-        writeIndent(textStream, indent + 1);
-        textStream << "(deep color 1)\n";
-    }
-    
</del><ins>+    if (m_layer->wantsDeepColorBackingStore())
+        textStream << indent << "(deep color 1)\n";
+
+
</ins><span class="cx">     if (behavior & LayerTreeAsTextIncludeContentLayers) {
</span><del>-        dumpInnerLayer(textStream, "structural layer", m_structuralLayer.get(), indent, behavior);
-        dumpInnerLayer(textStream, "contents clipping layer", m_contentsClippingLayer.get(), indent, behavior);
-        dumpInnerLayer(textStream, "shape mask layer", m_shapeMaskLayer.get(), indent, behavior);
-        dumpInnerLayer(textStream, "backdrop clipping layer", m_backdropClippingLayer.get(), indent, behavior);
-        dumpInnerLayer(textStream, "contents layer", m_contentsLayer.get(), indent, behavior);
-        dumpInnerLayer(textStream, "contents shape mask layer", m_contentsShapeMaskLayer.get(), indent, behavior);
-        dumpInnerLayer(textStream, "backdrop layer", m_backdropLayer.get(), indent, behavior);
</del><ins>+        dumpInnerLayer(textStream, "structural layer", m_structuralLayer.get(), behavior);
+        dumpInnerLayer(textStream, "contents clipping layer", m_contentsClippingLayer.get(), behavior);
+        dumpInnerLayer(textStream, "shape mask layer", m_shapeMaskLayer.get(), behavior);
+        dumpInnerLayer(textStream, "backdrop clipping layer", m_backdropClippingLayer.get(), behavior);
+        dumpInnerLayer(textStream, "contents layer", m_contentsLayer.get(), behavior);
+        dumpInnerLayer(textStream, "contents shape mask layer", m_contentsShapeMaskLayer.get(), behavior);
+        dumpInnerLayer(textStream, "backdrop layer", m_backdropLayer.get(), behavior);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (behavior & LayerTreeAsTextDebug) {
</span><del>-        writeIndent(textStream, indent + 1);
-        textStream << "(accelerates drawing " << m_acceleratesDrawing << ")\n";
-        writeIndent(textStream, indent + 1);
-        textStream << "(uses display-list drawing " << m_usesDisplayListDrawing << ")\n";
</del><ins>+        textStream << indent << "(accelerates drawing " << m_acceleratesDrawing << ")\n";
+        textStream << indent << "(uses display-list drawing " << m_usesDisplayListDrawing << ")\n";
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (225219 => 225220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h      2017-11-28 16:41:17 UTC (rev 225219)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2017-11-28 17:39:17 UTC (rev 225220)
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">     WEBCORE_EXPORT bool canThrottleLayerFlush() const override;
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void getDebugBorderInfo(Color&, float& width) const override;
</span><del>-    WEBCORE_EXPORT void dumpAdditionalProperties(WTF::TextStream&, int indent, LayerTreeAsTextBehavior) const override;
</del><ins>+    WEBCORE_EXPORT void dumpAdditionalProperties(WTF::TextStream&, LayerTreeAsTextBehavior) const override;
</ins><span class="cx"> 
</span><span class="cx">     void computePixelAlignment(float contentsScale, const FloatPoint& positionRelativeToBase,
</span><span class="cx">         FloatPoint& position, FloatPoint3D& anchorPoint, FloatSize& alignmentOffset) const;
</span></span></pre>
</div>
</div>

</body>
</html>