Lots of compositing test failures after r167152
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Apr 2014 15:42:28 +0000 (15:42 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Apr 2014 15:42:28 +0000 (15:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131574

Reviewed by Darin Adler.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::dumpChildren):
(WebCore::GraphicsLayer::dumpProperties):
Make child-dumping recursive so that we can easily skip layers up to any depth.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167246 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.cpp

index e4f0ed9..258c023 100644 (file)
@@ -1,3 +1,15 @@
+2014-04-14  Tim Horton  <timothy_horton@apple.com>
+
+        Lots of compositing test failures after r167152
+        https://bugs.webkit.org/show_bug.cgi?id=131574
+
+        Reviewed by Darin Adler.
+
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::dumpChildren):
+        (WebCore::GraphicsLayer::dumpProperties):
+        Make child-dumping recursive so that we can easily skip layers up to any depth.
+
 2014-04-14  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
 
         Fix incorrect indentations in CodeGeneratorJS.pm introduced in r165521
 2014-04-14  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
 
         Fix incorrect indentations in CodeGeneratorJS.pm introduced in r165521
index 2472af6..89f11f1 100644 (file)
@@ -589,6 +589,20 @@ void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeAsTextBehavio
     ts << ")\n";
 }
 
     ts << ")\n";
 }
 
+static void dumpChildren(TextStream& ts, const Vector<GraphicsLayer*>& children, unsigned& totalChildCount, int indent, LayerTreeAsTextBehavior behavior)
+{
+    totalChildCount += children.size();
+    for (auto* child : children) {
+        if (!child->client()->shouldSkipLayerInDump(child)) {
+            child->dumpLayer(ts, indent + 2, behavior);
+            continue;
+        }
+
+        totalChildCount--;
+        dumpChildren(ts, child->children(), totalChildCount, indent, behavior);
+    }
+}
+
 void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
 {
     if (m_position != FloatPoint()) {
 void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
 {
     if (m_position != FloatPoint()) {
@@ -754,19 +768,9 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBe
     
     if (m_children.size()) {
         TextStream childrenStream;
     
     if (m_children.size()) {
         TextStream childrenStream;
-        unsigned totalChildCount = m_children.size();
-        for (size_t childIndex = 0; childIndex < m_children.size(); childIndex++) {
-            GraphicsLayer* child = m_children[childIndex];
-            if (!child->client()->shouldSkipLayerInDump(child)) {
-                child->dumpLayer(childrenStream, indent + 2, behavior);
-                continue;
-            }
-            
-            const Vector<GraphicsLayer*>& grandChildren = child->children();
-            totalChildCount += grandChildren.size() - 1;
-            for (size_t grandChildIndex = 0; grandChildIndex < grandChildren.size(); grandChildIndex++)
-                grandChildren[grandChildIndex]->dumpLayer(childrenStream, indent + 2, behavior);
-        }
+
+        unsigned totalChildCount = 0;
+        dumpChildren(childrenStream, m_children, totalChildCount, indent, behavior);
 
         writeIndent(childrenStream, indent + 1);
         childrenStream << ")\n";
 
         writeIndent(childrenStream, indent + 1);
         childrenStream << ")\n";