Changeset 242741 in webkit
- Timestamp:
- Mar 11, 2019, 2:26:54 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r242740 r242741 1 2019-03-11 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: CPU Usage Timeline - Enable by default 4 https://bugs.webkit.org/show_bug.cgi?id=195471 5 6 Reviewed by Devin Rousso. 7 8 Remove experimental setting and include the CPU timeline in the 9 default set of timelines. 10 11 * UserInterface/Base/Setting.js: 12 * UserInterface/Controllers/TimelineManager.js: 13 (WI.TimelineManager.defaultTimelineTypes): 14 * UserInterface/Main.html: 15 * UserInterface/Views/CPUTimelineOverviewGraph.css: 16 (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.selected): 17 (.timeline-overview-graph.cpu > .column-chart > svg > rect): Deleted. 18 (body[dir=rtl] .timeline-overview-graph.cpu > .column-chart): Deleted. 19 * UserInterface/Views/CPUTimelineOverviewGraph.js: 20 (WI.CPUTimelineOverviewGraph): 21 (WI.CPUTimelineOverviewGraph.prototype.layout): 22 * UserInterface/Views/ContentView.js: 23 (WI.ContentView.createFromRepresentedObject): 24 * UserInterface/Views/LegacyCPUTimelineView.css: Removed. 25 * UserInterface/Views/LegacyCPUTimelineView.js: Removed. 26 * UserInterface/Views/SettingsTabContentView.js: 27 (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): 28 * UserInterface/Views/Variables.css: 29 (:root): 30 1 31 2019-03-11 Joseph Pecoraro <pecoraro@apple.com> 2 32 -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r242622 r242741 159 159 160 160 // Experimental 161 experimentalEnableCPUUsageEnhancements: new WI.Setting("experimental-cpu-usage", false),162 161 experimentalEnableLayersTab: new WI.Setting("experimental-enable-layers-tab", false), 163 162 experimentalEnableNewTabBar: new WI.Setting("experimental-enable-new-tab-bar", false), -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r242370 r242741 108 108 ]; 109 109 110 if (WI.CPUInstrument.supported()) 111 defaultTypes.push(WI.TimelineRecord.Type.CPU); 112 110 113 if (WI.FPSInstrument.supported()) 111 114 defaultTypes.push(WI.TimelineRecord.Type.RenderingFrame); -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r242739 r242741 130 130 <link rel="stylesheet" href="Views/LayoutTimelineOverviewGraph.css"> 131 131 <link rel="stylesheet" href="Views/LayoutTimelineView.css"> 132 <link rel="stylesheet" href="Views/LegacyCPUTimelineView.css">133 132 <link rel="stylesheet" href="Views/LogContentView.css"> 134 133 <link rel="stylesheet" href="Views/LogIcon.css"> … … 713 712 <script src="Views/LayoutTimelineOverviewGraph.js"></script> 714 713 <script src="Views/LayoutTimelineView.js"></script> 715 <script src="Views/LegacyCPUTimelineView.js"></script>716 714 <script src="Views/LogContentView.js"></script> 717 715 <script src="Views/MediaTimelineDataGridNode.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.css
r242739 r242741 83 83 stroke-opacity: 0.8; 84 84 } 85 86 /* LegacyCPUTimeline */87 .timeline-overview-graph.cpu > .column-chart > svg > rect {88 stroke: var(--cpu-stroke-color);89 fill: var(--cpu-main-thread-fill-color);90 }91 92 body[dir=rtl] .timeline-overview-graph.cpu > .column-chart {93 transform: scaleX(-1);94 } -
trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js
r242567 r242741 39 39 40 40 let size = new WI.Size(0, this.height); 41 if (WI.settings.experimentalEnableCPUUsageEnhancements.value) { 42 this._chart = new WI.StackedColumnChart(size); 43 this._chart.initializeSections(["main-thread-usage", "worker-thread-usage", "total-usage"]); 44 } else 45 this._chart = new WI.ColumnChart(size); 41 this._chart = new WI.StackedColumnChart(size); 42 this._chart.initializeSections(["main-thread-usage", "worker-thread-usage", "total-usage"]); 46 43 this.addSubview(this._chart); 47 44 this.element.appendChild(this._chart.element); … … 130 127 // Bars for each record. 131 128 for (let record of visibleRecords) { 129 let additionalClass = record === this.selectedRecord ? "selected" : undefined; 132 130 let w = intervalWidth; 131 let x = xScale(record.startTime - (CPUTimelineOverviewGraph.samplingRatePerSecond / 2)); 132 let h1 = Math.max(minimumDisplayHeight, yScale(record.mainThreadUsage)); 133 let h2 = Math.max(minimumDisplayHeight, yScale(record.mainThreadUsage + record.workerThreadUsage)); 133 134 let h3 = Math.max(minimumDisplayHeight, yScale(record.usage)); 134 let x = xScale(record.startTime - (CPUTimelineOverviewGraph.samplingRatePerSecond / 2)); 135 if (WI.settings.experimentalEnableCPUUsageEnhancements.value) { 136 let additionalClass = record === this.selectedRecord ? "selected" : undefined; 137 let h1 = Math.max(minimumDisplayHeight, yScale(record.mainThreadUsage)); 138 let h2 = Math.max(minimumDisplayHeight, yScale(record.mainThreadUsage + record.workerThreadUsage)); 139 this._chart.addColumnSet(x, height, w, [h1, h2, h3], additionalClass); 140 } else 141 this._chart.addColumn(x, height - h3, w, h3); 135 this._chart.addColumnSet(x, height, w, [h1, h2, h3], additionalClass); 142 136 } 143 137 } -
trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js
r241642 r242741 84 84 return new WI.RenderingFrameTimelineView(representedObject, extraArguments); 85 85 86 if (timelineType === WI.TimelineRecord.Type.CPU) { 87 if (WI.settings.experimentalEnableCPUUsageEnhancements.value) 88 return new WI.CPUTimelineView(representedObject, extraArguments); 89 return new WI.LegacyCPUTimelineView(representedObject, extraArguments); 90 } 86 if (timelineType === WI.TimelineRecord.Type.CPU) 87 return new WI.CPUTimelineView(representedObject, extraArguments); 91 88 92 89 if (timelineType === WI.TimelineRecord.Type.Memory) -
trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
r242622 r242741 273 273 experimentalSettingsView.addSeparator(); 274 274 275 experimentalSettingsView.addSetting(WI.unlocalizedString("CPU Usage:"), WI.settings.experimentalEnableCPUUsageEnhancements, WI.unlocalizedString("Enhancements"));276 experimentalSettingsView.addSeparator();277 278 275 experimentalSettingsView.addSetting(WI.UIString("Styles:"), WI.settings.experimentalEnableStylesJumpToEffective, WI.UIString("Show Jump to Effective Property Button")); 279 276 experimentalSettingsView.addSeparator(); … … 306 303 listenForChange(WI.settings.experimentalEnableLayersTab); 307 304 listenForChange(WI.settings.experimentalEnableNewTabBar); 308 listenForChange(WI.settings.experimentalEnableCPUUsageEnhancements);309 305 listenForChange(WI.settings.experimentalEnableStylesJumpToEffective); 310 306 -
trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css
r242739 r242741 133 133 --memory-max-comparison-stroke-color: hsl(220, 10%, 55%); 134 134 135 /* LegacyCPUTimeline */136 --cpu-fill-color: hsl(81, 80%, 50%);137 --cpu-stroke-color: hsl(118, 33%, 42%);138 139 135 --cpu-other-thread-fill-color: hsl(81, 80%, 50%); 140 136 --cpu-other-thread-stroke-color: hsl(81, 80%, 30%);
Note:
See TracChangeset
for help on using the changeset viewer.