Changeset 143000 in webkit
- Timestamp:
- Feb 15, 2013 7:56:51 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142998 r143000 1 2013-02-15 Andrey Adaikin <aandrey@chromium.org> 2 3 Web Inspector: [Canvas] show replay log grouped by draw calls 4 https://bugs.webkit.org/show_bug.cgi?id=109592 5 6 Reviewed by Pavel Feldman. 7 8 A test to dump canvas replay log. 9 10 * inspector/profiler/canvas2d/canvas-replay-log-grid-expected.txt: Added. 11 * inspector/profiler/canvas2d/canvas-replay-log-grid.html: Added. 12 1 13 2013-02-15 Vsevolod Vlasov <vsevik@chromium.org> 2 14 -
trunk/LayoutTests/platform/efl/TestExpectations
r142993 r143000 1609 1609 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html 1610 1610 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html 1611 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html 1611 1612 1612 1613 # EFL port does not support Emacs commands. -
trunk/LayoutTests/platform/gtk/TestExpectations
r142980 r143000 1040 1040 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html [ Failure ] 1041 1041 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html [ Failure ] 1042 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html [ Failure ] 1042 1043 1043 1044 webkit.org/b/37613 webkit.org/b/20011 printing [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r142983 r143000 289 289 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html 290 290 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html 291 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html 291 292 292 293 # Skipping newly added tests while I'm finding out what is wrong. -
trunk/LayoutTests/platform/qt/TestExpectations
r142991 r143000 2507 2507 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html 2508 2508 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html 2509 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html 2509 2510 2510 2511 # [Qt] Unidentified pixel failures -
trunk/LayoutTests/platform/win/TestExpectations
r142947 r143000 1314 1314 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html 1315 1315 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html 1316 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html 1316 1317 1317 1318 # https://bugs.webkit.org/show_bug.cgi?id=40300 -
trunk/LayoutTests/platform/wincairo/TestExpectations
r142883 r143000 1832 1832 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-has-uninstrumented-canvases.html 1833 1833 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-stack-trace.html 1834 webkit.org/b/73936 inspector/profiler/canvas2d/canvas-replay-log-grid.html 1834 1835 1835 1836 # https://bugs.webkit.org/show_bug.cgi?id=40300 -
trunk/Source/WebCore/ChangeLog
r142999 r143000 1 2013-02-15 Andrey Adaikin <aandrey@chromium.org> 2 3 Web Inspector: [Canvas] show replay log grouped by draw calls 4 https://bugs.webkit.org/show_bug.cgi?id=109592 5 6 Reviewed by Pavel Feldman. 7 8 Show canvas capturing log grouped by drawing calls. 9 Drive-by: extended Array.prototype with a handy peekLast function. 10 Drive-by: removed code dups in few places. 11 12 * inspector/front-end/CanvasProfileView.js: 13 (WebInspector.CanvasProfileView): 14 (WebInspector.CanvasProfileView.prototype.dispose): 15 (WebInspector.CanvasProfileView.prototype._onReplayStepClick): 16 (WebInspector.CanvasProfileView.prototype._onReplayDrawingCallClick): 17 (WebInspector.CanvasProfileView.prototype._onReplayLastStepClick): 18 (WebInspector.CanvasProfileView.prototype._replayTraceLog.didReplayTraceLog): 19 (WebInspector.CanvasProfileView.prototype._replayTraceLog): 20 (WebInspector.CanvasProfileView.prototype._didReceiveTraceLog): 21 (WebInspector.CanvasProfileView.prototype._selectedCallIndex): 22 (WebInspector.CanvasProfileView.prototype._selectedDrawCallGroupIndex): 23 (WebInspector.CanvasProfileView.prototype._appendCallNode): 24 * inspector/front-end/DataGrid.js: 25 (WebInspector.DataGrid.prototype.setColumnVisible): 26 (WebInspector.DataGridNode.prototype.set hasChildren): 27 (WebInspector.DataGridNode.prototype.set revealed): 28 (WebInspector.DataGridNode.prototype.get leftPadding): 29 * inspector/front-end/externs.js: 30 (Array.prototype.peekLast): 31 * inspector/front-end/utilities.js: 32 1 33 2013-02-15 Yury Semikhatsky <yurys@chromium.org> 2 34 -
trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js
r141883 r143000 77 77 columns[1].sortable = true; 78 78 columns[1].width = "75%"; 79 columns[1].disclosure = true; 79 80 columns[2].title = WebInspector.UIString("Location"); 80 81 columns[2].sortable = true; … … 88 89 /** @type {!Array.<WebInspector.DataGridNode>} */ 89 90 this._logGridNodes = []; 91 /** @type {!Array.<WebInspector.DataGridNode>} */ 92 this._drawCallGroups = []; 90 93 91 94 this._splitView.show(this.element); … … 103 106 { 104 107 this._logGridNodes = []; 108 this._drawCallGroupNodes = []; 105 109 this._linkifier.reset(); 106 110 }, … … 175 179 _onReplayStepClick: function(forward) 176 180 { 177 var selectedNode = this._logGrid.selectedNode;178 if ( !selectedNode)181 var index = this._selectedCallIndex(); 182 if (index === -1) 179 183 return; 180 var nextNode = forward ? selectedNode.traverseNextNode(false) : selectedNode.traversePreviousNode(false); 181 if (nextNode) 182 nextNode.revealAndSelect(); 183 else 184 selectedNode.reveal(); 184 var nextNode = this._logGridNodes[forward ? index + 1 : index - 1] || this._logGridNodes[index]; 185 nextNode.revealAndSelect(); 185 186 }, 186 187 … … 190 191 _onReplayDrawingCallClick: function(forward) 191 192 { 192 var callNode = this._logGrid.selectedNode;193 if ( !callNode)193 var index = this._selectedDrawCallGroupIndex(); 194 if (index === -1) 194 195 return; 195 var index = callNode.index; 196 do { 197 var nextIndex = forward ? index + 1 : index - 1; 198 var nextCallNode = this._logGridNodes[nextIndex]; 199 if (!nextCallNode) 200 break; 201 index = nextIndex; 202 callNode = nextCallNode; 203 } while (!callNode.call.isDrawingCall); 204 callNode.revealAndSelect(); 196 var nextNode = this._drawCallGroups[forward ? index + 1 : index - 1] || this._drawCallGroups[index]; 197 nextNode.revealAndSelect(); 205 198 }, 206 199 … … 214 207 _onReplayLastStepClick: function() 215 208 { 216 var children = this._logGrid.rootNode().children; 217 var lastNode = children[children.length - 1]; 209 var lastNode = this._logGrid.rootNode().children.peekLast(); 218 210 if (lastNode) 219 211 lastNode.revealAndSelect(); … … 246 238 _replayTraceLog: function() 247 239 { 248 var callNode = this._logGrid.selectedNode;249 if ( !callNode)240 var index = this._selectedCallIndex(); 241 if (index === -1 || index === this._lastReplayCallIndex) 250 242 return; 243 this._lastReplayCallIndex = index; 251 244 var time = Date.now(); 252 245 /** … … 256 249 function didReplayTraceLog(error, resourceState) 257 250 { 258 if ( callNode !== this._logGrid.selectedNode)251 if (index !== this._selectedCallIndex()) 259 252 return; 260 253 … … 271 264 } 272 265 this._enableWaitIcon(true); 273 CanvasAgent.replayTraceLog(this._traceLogId, callNode.index, didReplayTraceLog.bind(this));266 CanvasAgent.replayTraceLog(this._traceLogId, index, didReplayTraceLog.bind(this)); 274 267 }, 275 268 … … 283 276 if (error || !traceLog) 284 277 return; 285 var lastNode = null;286 278 var calls = traceLog.calls; 287 279 for (var i = 0, n = calls.length; i < n; ++i) { … … 290 282 var index = traceLog.startOffset + i; 291 283 var gridNode = this._createCallNode(index, call); 292 this._logGrid.rootNode().appendChild(gridNode); 293 lastNode = gridNode; 294 } 295 if (lastNode) 296 lastNode.revealAndSelect(); 284 this._appendCallNode(gridNode); 285 } 297 286 if (traceLog.alive) 298 287 setTimeout(this._requestTraceLog.bind(this), WebInspector.CanvasProfileView.TraceLogPollingInterval); 299 288 this._profile._updateCapturingStatus(traceLog); 289 this._onReplayLastStepClick(); // Automatically replay the last step. 300 290 }, 301 291 … … 327 317 } 328 318 CanvasAgent.getResourceInfo(contextId, didReceiveResourceInfo.bind(this)); 319 }, 320 321 /** 322 * @return {number} 323 */ 324 _selectedCallIndex: function() 325 { 326 var node = this._logGrid.selectedNode; 327 while (node) { 328 if (typeof node.index === "number") 329 return node.index; 330 node = node.children.peekLast(); 331 } 332 return -1; 333 }, 334 335 /** 336 * @return {number} 337 */ 338 _selectedDrawCallGroupIndex: function() 339 { 340 for (var node = this._logGrid.selectedNode; node; node = node.children.peekLast()) { 341 if (typeof node.drawCallGroupIndex === "number") 342 return node.drawCallGroupIndex; 343 } 344 for (var node = this._logGrid.selectedNode; node; node = node.parent) { 345 if (typeof node.drawCallGroupIndex === "number") 346 return node.drawCallGroupIndex; 347 } 348 return -1; 349 }, 350 351 /** 352 * @param {!WebInspector.DataGridNode} gridNode 353 */ 354 _appendCallNode: function(gridNode) 355 { 356 var drawCallGroup = this._drawCallGroups.peekLast(); 357 if (drawCallGroup) { 358 var lastNode = drawCallGroup.children.peekLast(); 359 if (lastNode && lastNode.call.isDrawingCall) 360 drawCallGroup = null; 361 } 362 if (!drawCallGroup) { 363 var index = this._drawCallGroups.length; 364 var data = {}; 365 data[0] = ""; 366 data[1] = "Draw call group #" + (index + 1); 367 data[2] = ""; 368 drawCallGroup = new WebInspector.DataGridNode(data); 369 drawCallGroup.selectable = true; 370 drawCallGroup.drawCallGroupIndex = index; 371 this._drawCallGroups.push(drawCallGroup); 372 this._logGrid.rootNode().appendChild(drawCallGroup); 373 } 374 drawCallGroup.appendChild(gridNode); 329 375 }, 330 376 -
trunk/Source/WebCore/inspector/front-end/DataGrid.js
r142976 r143000 629 629 630 630 this.columns[columnIdentifier].hidden = !visible; 631 if (visible) 632 this.element.removeStyleClass("hide-" + columnIdentifier + "-column"); 633 else 634 this.element.addStyleClass("hide-" + columnIdentifier + "-column"); 631 this.element.enableStyleClass("hide-" + columnIdentifier + "-column", !visible); 635 632 }, 636 633 … … 1150 1147 return; 1151 1148 1152 if (this._hasChildren) 1153 { 1154 this._element.addStyleClass("parent"); 1155 if (this.expanded) 1156 this._element.addStyleClass("expanded"); 1157 } 1158 else 1159 { 1160 this._element.removeStyleClass("parent"); 1161 this._element.removeStyleClass("expanded"); 1162 } 1149 this._element.enableStyleClass("parent", this._hasChildren); 1150 this._element.enableStyleClass("expanded", this._hasChildren && this.expanded); 1163 1151 }, 1164 1152 … … 1175 1163 this._revealed = x; 1176 1164 1177 if (this._element) { 1178 if (this._revealed) 1179 this._element.addStyleClass("revealed"); 1180 else 1181 this._element.removeStyleClass("revealed"); 1182 } 1165 if (this._element) 1166 this._element.enableStyleClass("revealed", this._revealed); 1183 1167 1184 1168 for (var i = 0; i < this.children.length; ++i) … … 1199 1183 get leftPadding() 1200 1184 { 1201 if (typeof (this._leftPadding)=== "number")1185 if (typeof this._leftPadding === "number") 1202 1186 return this._leftPadding; 1203 1187 … … 1635 1619 }, 1636 1620 1621 /** 1622 * @return {boolean} 1623 */ 1637 1624 isEventWithinDisclosureTriangle: function(event) 1638 1625 { -
trunk/Source/WebCore/inspector/front-end/externs.js
r142603 r143000 129 129 */ 130 130 Array.prototype.select = function(field) {} 131 132 /** 133 * @this {Array.<*>} 134 * @return {*} 135 */ 136 Array.prototype.peekLast = function() {} 131 137 132 138 DOMApplicationCache.prototype.UNCACHED = 0; -
trunk/Source/WebCore/inspector/front-end/utilities.js
r142128 r143000 428 428 }); 429 429 430 Object.defineProperty(Array.prototype, "peekLast", 431 { 432 /** 433 * @this {Array.<*>} 434 * @return {*} 435 */ 436 value: function() 437 { 438 return this[this.length - 1]; 439 } 440 }); 441 430 442 /** 431 443 * @param {*} anObject
Note: See TracChangeset
for help on using the changeset viewer.