Changeset 136418 in webkit
- Timestamp:
- Dec 3, 2012, 10:59:29 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r136417 r136418 1 2012-12-03 Andrey Adaikin <aandrey@chromium.org> 2 3 Web Inspector: [Canvas] show replay screenshot of the last call's canvas 4 https://bugs.webkit.org/show_bug.cgi?id=103739 5 6 Reviewed by Pavel Feldman. 7 8 When many canvases are being instrumented we'll want to show replay screenshots for each canvas. 9 Meanwhile, show the screenshot of the last-touched canvas during the current replay. 10 11 * inspector/InjectedScriptCanvasModuleSource.js: 12 (.): 13 1 14 2012-12-03 Joshua Bell <jsbell@chromium.org> 2 15 -
trunk/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js
r135711 r136418 2415 2415 }, 2416 2416 2417 /** 2418 * @return {Call} 2419 */ 2417 2420 step: function() 2418 2421 { 2419 this.stepTo(this._nextReplayStep);2422 return this.stepTo(this._nextReplayStep); 2420 2423 }, 2421 2424 2422 2425 /** 2423 2426 * @param {number} stepNum 2427 * @return {Call} 2424 2428 */ 2425 2429 stepTo: function(stepNum) … … 2430 2434 this.reset(); 2431 2435 // FIXME: Replay all the cached resources first to warm-up. 2436 var lastCall = null; 2432 2437 var replayableCalls = this._traceLog.replayableCalls(); 2433 2438 while (this._nextReplayStep <= stepNum) 2434 replayableCalls[this._nextReplayStep++].replay(this._replayWorldCache); 2435 }, 2436 2439 lastCall = replayableCalls[this._nextReplayStep++].replay(this._replayWorldCache); 2440 return lastCall; 2441 }, 2442 2443 /** 2444 * @return {Call} 2445 */ 2437 2446 replay: function() 2438 2447 { 2439 this.stepTo(this._traceLog.size() - 1);2448 return this.stepTo(this._traceLog.size() - 1); 2440 2449 } 2441 2450 } … … 2705 2714 this._traceLogPlayer = new TraceLogPlayer(traceLog, this._onTraceLogPlayerReset.bind(this)); 2706 2715 } 2707 this._traceLogPlayer.stepTo(stepNo);2716 var lastCall = this._traceLogPlayer.stepTo(stepNo); 2708 2717 if (!this._replayContexts.length) { 2709 2718 console.error("ASSERT_NOT_REACHED: replayTraceLog failed to create a replay canvas?!"); 2710 2719 return ""; 2711 2720 } 2712 // Return current screenshot.2713 2721 // FIXME: Support replaying several canvases simultaneously. 2722 var lastCallResourceContext = Resource.wrappedObject(lastCall.resource()); 2723 for (var i = 0, n = this._replayContexts.length; i < n; ++i) { 2724 var context = this._replayContexts[i].context; 2725 if (lastCallResourceContext === context) 2726 return context.canvas.toDataURL(); 2727 } 2728 console.assert("ASSERT_NOT_REACHED: replayTraceLog failed to match the replaying canvas?!"); 2714 2729 return this._replayContexts[0].context.canvas.toDataURL(); 2715 2730 },
Note:
See TracChangeset
for help on using the changeset viewer.