Title: [143731] trunk/Source/WebCore
Revision
143731
Author
[email protected]
Date
2013-02-22 08:17:31 -0800 (Fri, 22 Feb 2013)

Log Message

Web Inspector: [Canvas] do no show a single frame node in data grid
https://bugs.webkit.org/show_bug.cgi?id=110473

Reviewed by Pavel Feldman.

In a single canvas frame capture mode do not show the single "Frame #1" node.
Drive-by: Fix a wrong "this" pointer.

* inspector/front-end/CanvasProfileView.js:
(WebInspector.CanvasProfileView.prototype._didReceiveTraceLog):
(WebInspector.CanvasProfileView.prototype.appendDrawCallGroup):
(WebInspector.CanvasProfileView.prototype._flattenSingleFrameNode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143730 => 143731)


--- trunk/Source/WebCore/ChangeLog	2013-02-22 16:12:40 UTC (rev 143730)
+++ trunk/Source/WebCore/ChangeLog	2013-02-22 16:17:31 UTC (rev 143731)
@@ -1,3 +1,18 @@
+2013-02-22  Andrey Adaikin  <[email protected]>
+
+        Web Inspector: [Canvas] do no show a single frame node in data grid
+        https://bugs.webkit.org/show_bug.cgi?id=110473
+
+        Reviewed by Pavel Feldman.
+
+        In a single canvas frame capture mode do not show the single "Frame #1" node.
+        Drive-by: Fix a wrong "this" pointer.
+
+        * inspector/front-end/CanvasProfileView.js:
+        (WebInspector.CanvasProfileView.prototype._didReceiveTraceLog):
+        (WebInspector.CanvasProfileView.prototype.appendDrawCallGroup):
+        (WebInspector.CanvasProfileView.prototype._flattenSingleFrameNode):
+
 2013-02-22  Allan Sandfeld Jensen  <[email protected]>
 
         Multiple Layout Test crashes (ASSERT) on chromium linux debug after r143727

Modified: trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js (143730 => 143731)


--- trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js	2013-02-22 16:12:40 UTC (rev 143730)
+++ trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js	2013-02-22 16:17:31 UTC (rev 143731)
@@ -288,6 +288,8 @@
         this._appendCallNodes(callNodes);
         if (traceLog.alive)
             setTimeout(this._requestTraceLog.bind(this, index), WebInspector.CanvasProfileView.TraceLogPollingInterval);
+        else
+            this._flattenSingleFrameNode();
         this._profile._updateCapturingStatus(traceLog);
         this._onReplayLastStepClick(); // Automatically replay the last step.
     },
@@ -382,16 +384,17 @@
      */
     _appendCallNodesToFrameNode: function(frameNode, callNodes, fromIndex, toIndex)
     {
+        var self = this;
         function appendDrawCallGroup()
         {
-            var index = this._drawCallGroupsCount || 0;
+            var index = self._drawCallGroupsCount || 0;
             var data = ""
             data[0] = "";
             data[1] = "Draw call group #" + (index + 1);
             data[2] = "";
             var node = new WebInspector.DataGridNode(data);
             node.selectable = true;
-            this._drawCallGroupsCount = index + 1;
+            self._drawCallGroupsCount = index + 1;
             frameNode.appendChild(node);
             return node;
         }
@@ -472,6 +475,17 @@
         return node;
     },
 
+    _flattenSingleFrameNode: function()
+    {
+        var rootNode = this._logGrid.rootNode();
+        if (rootNode.children.length !== 1)
+            return;
+        var frameNode = rootNode.children[0];
+        while (frameNode.children[0])
+            rootNode.appendChild(frameNode.children[0]);
+        rootNode.removeChild(frameNode);
+    },
+
     __proto__: WebInspector.View.prototype
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to