Skip to content

Commit

Permalink
Web Inspector: [Canvas] do no show a single frame node in data grid
Browse files Browse the repository at this point in the history
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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aandrey@chromium.org committed Feb 22, 2013
1 parent a2b1732 commit dffffc0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2013-02-22 Andrey Adaikin <aandrey@chromium.org>

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 <allan.jensen@digia.com>

Multiple Layout Test crashes (ASSERT) on chromium linux debug after r143727
Expand Down
18 changes: 16 additions & 2 deletions Source/WebCore/inspector/front-end/CanvasProfileView.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ WebInspector.CanvasProfileView.prototype = {
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.
},
Expand Down Expand Up @@ -382,16 +384,17 @@ WebInspector.CanvasProfileView.prototype = {
*/
_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;
}
Expand Down Expand Up @@ -472,6 +475,17 @@ WebInspector.CanvasProfileView.prototype = {
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
}

Expand Down

0 comments on commit dffffc0

Please sign in to comment.