Changeset 83276 in webkit
- Timestamp:
- Apr 8, 2011 2:55:03 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83275 r83276 1 2011-04-08 Andrey Adaikin <aandrey@google.com> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Tweak dynamically constants for the async highlighting in text editor 6 https://bugs.webkit.org/show_bug.cgi?id=58035 7 8 * inspector/front-end/TextViewer.js: 9 (WebInspector.TextEditorMainPanel.prototype._expandChunks): 10 (WebInspector.TextEditorMainPanel.prototype._schedulePaintLines): 11 (WebInspector.TextEditorMainPanel.prototype._paintScheduledLines): 12 (WebInspector.TextEditorMainPanel.prototype._restorePaintLinesOperationsCredit): 13 (WebInspector.TextEditorMainPanel.prototype._adjustPaintLinesOperationsRefreshValue): 14 1 15 2011-04-08 Andrey Kosyakov <caseq@chromium.org> 2 16 -
trunk/Source/WebCore/inspector/front-end/TextViewer.js
r82824 r83276 857 857 this._restorePaintLinesOperationsCredit(); 858 858 WebInspector.TextEditorChunkedPanel.prototype._expandChunks.call(this, fromIndex, toIndex); 859 this._adjustPaintLinesOperationsRefreshValue(); 859 860 860 861 this._restoreSelection(selection); … … 876 877 if (!this._scheduledPaintLines) { 877 878 this._scheduledPaintLines = [ { startLine: startLine, endLine: endLine } ]; 878 this._paintScheduledLinesTimer = setTimeout(this._paintScheduledLines.bind(this), 10);879 this._paintScheduledLinesTimer = setTimeout(this._paintScheduledLines.bind(this), 0); 879 880 } else { 880 881 for (var i = 0; i < this._scheduledPaintLines.length; ++i) { … … 911 912 var scheduledPaintLines = this._scheduledPaintLines; 912 913 delete this._scheduledPaintLines; 913 914 914 915 this._restorePaintLinesOperationsCredit(); 915 916 this._paintLineChunks(scheduledPaintLines, !skipRestoreSelection); 917 this._adjustPaintLinesOperationsRefreshValue(); 916 918 }, 917 919 918 920 _restorePaintLinesOperationsCredit: function() 919 921 { 920 this._paintLinesOperationsCredit = 250; 922 if (!this._paintLinesOperationsRefreshValue) 923 this._paintLinesOperationsRefreshValue = 250; 924 this._paintLinesOperationsCredit = this._paintLinesOperationsRefreshValue; 925 this._paintLinesOperationsLastRefresh = Date.now(); 926 }, 927 928 _adjustPaintLinesOperationsRefreshValue: function() 929 { 930 var operationsDone = this._paintLinesOperationsRefreshValue - this._paintLinesOperationsCredit; 931 if (operationsDone <= 0) 932 return; 933 var timePast = Date.now() - this._paintLinesOperationsLastRefresh; 934 if (timePast <= 0) 935 return; 936 // Make the synchronous CPU chunk for painting the lines 50 msec. 937 var value = Math.floor(operationsDone / timePast * 50); 938 this._paintLinesOperationsRefreshValue = Number.constrain(value, 150, 1500); 921 939 }, 922 940
Note: See TracChangeset
for help on using the changeset viewer.