Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: content/browser/resources/gpu/info_view.js

Issue 344653004: Cleanup logic that generates about:gpu feature status. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove gpu_switching and change Flash Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/gpu/compositor_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * @fileoverview This view displays information on the current GPU 7 * @fileoverview This view displays information on the current GPU
8 * hardware. Its primary usefulness is to allow users to copy-paste 8 * hardware. Its primary usefulness is to allow users to copy-paste
9 * their data in an easy to read format for bug reports. 9 * their data in an easy to read format for bug reports.
10 */ 10 */
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } else { 78 } else {
79 this.setText_('client-info', '... loading...'); 79 this.setText_('client-info', '... loading...');
80 } 80 }
81 81
82 // Feature map 82 // Feature map
83 var featureLabelMap = { 83 var featureLabelMap = {
84 '2d_canvas': 'Canvas', 84 '2d_canvas': 'Canvas',
85 'gpu_compositing': 'Compositing', 85 'gpu_compositing': 'Compositing',
86 'webgl': 'WebGL', 86 'webgl': 'WebGL',
87 'multisampling': 'WebGL multisampling', 87 'multisampling': 'WebGL multisampling',
88 'flash_3d': 'Flash 3D', 88 'flash_3d': 'Flash',
89 'flash_stage3d': 'Flash Stage3D', 89 'flash_stage3d': 'Flash Stage3D',
90 'flash_stage3d_baseline': 'Flash Stage3D Baseline profile', 90 'flash_stage3d_baseline': 'Flash Stage3D Baseline profile',
91 'texture_sharing': 'Texture Sharing', 91 'texture_sharing': 'Texture Sharing',
92 'video_decode': 'Video Decode', 92 'video_decode': 'Video Decode',
93 'video_encode': 'Video Encode', 93 'video_encode': 'Video Encode',
94 // GPU Switching
95 'gpu_switching': 'GPU Switching',
96 'panel_fitting': 'Panel Fitting', 94 'panel_fitting': 'Panel Fitting',
97 'rasterization': 'Rasterization', 95 'rasterization': 'Rasterization',
98 }; 96 'threaded_rasterization': 'Threaded Rasterization',
99 var statusLabelMap = {
100 'disabled_software': 'Software only. Hardware acceleration disabled.',
101 'disabled_software_animated': 'Software animated.',
102 'disabled_software_multithreaded': 'Software only, multi-threaded',
103 'disabled_off': 'Unavailable. Hardware acceleration disabled.',
104 'software': 'Software rendered. Hardware acceleration not enabled.',
105 'unavailable_off': 'Unavailable. Hardware acceleration unavailable',
106 'unavailable_software':
107 'Software only, hardware acceleration unavailable',
108 'unavailable_software_threaded':
109 'Software only and threaded. Hardware acceleration unavailable.',
110 'enabled_readback': 'Hardware accelerated, but at reduced performance',
111 'enabled_force': 'Hardware accelerated',
112 'enabled_threaded': 'Hardware accelerated and threaded.',
113 'enabled': 'Hardware accelerated',
114 'accelerated': 'Accelerated',
115 'accelerated_threaded': 'Accelerated and threaded',
116 // GPU Switching
117 'gpu_switching_automatic': 'Automatic switching',
118 'gpu_switching_force_discrete': 'Always on discrete GPU',
119 'gpu_switching_force_integrated': 'Always on integrated GPU',
120 }; 97 };
121 98
122 var statusClassMap = { 99 var statusMap = {
123 'disabled_software': 'feature-yellow', 100 'disabled_software': {
124 'disabled_software_animated': 'feature-yellow', 101 'label': 'Software only. Hardware acceleration disabled',
125 'disabled_software_multithreaded': 'feature-yellow', 102 'class': 'feature-yellow'
126 'disabled_off': 'feature-red', 103 },
127 'software': 'feature-yellow', 104 'disabled_software_threaded': {
128 'unavailable_off': 'feature-red', 105 'label': 'Software only, threaded. Hardware acceleration disabled',
129 'unavailable_software': 'feature-yellow', 106 'class': 'feature-yellow'
130 'unavailable_software_threaded': 'feature-yellow', 107 },
131 'enabled_force': 'feature-green', 108 'disabled_off': {
132 'enabled_readback': 'feature-yellow', 109 'label': 'Disabled',
133 'enabled_threaded': 'feature-green', 110 'class': 'feature-red'
134 'enabled': 'feature-green', 111 },
135 'accelerated': 'feature-green', 112 'disabled_off_ok': {
136 'accelerated_threaded': 'feature-green', 113 'label': 'Disabled',
114 'class': 'feature-yellow'
115 },
116 'unavailable_software': {
117 'label': 'Software only, hardware acceleration unavailable',
118 'class': 'feature-yellow'
119 },
120 'unavailable_software_threaded': {
121 'label': 'Software only, threaded. Hardware acceleration unavailable',
122 'class': 'feature-yellow'
123 },
124 'unavailable_off': {
125 'label': 'Unavailable',
126 'class': 'feature-red'
127 },
128 'unavailable_off_ok': {
129 'label': 'Unavailable',
130 'class': 'feature-yellow'
131 },
132 'enabled_readback': {
133 'label': 'Hardware accelerated but at reduced performance',
134 'class': 'feature-yellow'
135 },
136 'enabled_force': {
137 'label': 'Hardware accelerated on all pages',
138 'class': 'feature-green'
139 },
140 'enabled_threaded': {
141 'label': 'Hardware accelerated and threaded',
142 'class': 'feature-green'
143 },
144 'enabled': {
145 'label': 'Hardware accelerated',
146 'class': 'feature-green'
147 },
148 'enabled_on': {
149 'label': 'Enabled',
150 'class': 'feature-green'
151 },
137 // GPU Switching 152 // GPU Switching
Zhenyao Mo 2014/06/19 16:52:00 What I mean is, you can get rid of the below three
138 'gpu_switching_automatic': 'feature-green', 153 'gpu_switching_automatic': {
139 'gpu_switching_force_discrete': 'feature-red', 154 'label': 'Automatic switching',
140 'gpu_switching_force_integrated': 'feature-red', 155 'class': 'feature-green'
156 },
157 'gpu_switching_force_discrete': {
158 'label': 'Always on discrete GPU',
159 'class': 'feature-red'
160 },
161 'gpu_switching_force_integrated': {
162 'label': 'Always on integrated GPU',
163 'class': 'feature-red'
164 }
141 }; 165 };
142 166
143 // GPU info, basic 167 // GPU info, basic
144 var diagnosticsDiv = this.querySelector('.diagnostics'); 168 var diagnosticsDiv = this.querySelector('.diagnostics');
145 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading'); 169 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading');
146 var featureStatusList = this.querySelector('.feature-status-list'); 170 var featureStatusList = this.querySelector('.feature-status-list');
147 var problemsDiv = this.querySelector('.problems-div'); 171 var problemsDiv = this.querySelector('.problems-div');
148 var problemsList = this.querySelector('.problems-list'); 172 var problemsList = this.querySelector('.problems-list');
149 var workaroundsDiv = this.querySelector('.workarounds-div'); 173 var workaroundsDiv = this.querySelector('.workarounds-div');
150 var workaroundsList = this.querySelector('.workarounds-list'); 174 var workaroundsList = this.querySelector('.workarounds-list');
(...skipping 11 matching lines...) Expand all
162 gpuInfo.featureStatus.featureStatus[featureName]; 186 gpuInfo.featureStatus.featureStatus[featureName];
163 var featureEl = document.createElement('li'); 187 var featureEl = document.createElement('li');
164 188
165 var nameEl = document.createElement('span'); 189 var nameEl = document.createElement('span');
166 if (!featureLabelMap[featureName]) 190 if (!featureLabelMap[featureName])
167 console.log('Missing featureLabel for', featureName); 191 console.log('Missing featureLabel for', featureName);
168 nameEl.textContent = featureLabelMap[featureName] + ': '; 192 nameEl.textContent = featureLabelMap[featureName] + ': ';
169 featureEl.appendChild(nameEl); 193 featureEl.appendChild(nameEl);
170 194
171 var statusEl = document.createElement('span'); 195 var statusEl = document.createElement('span');
172 if (!statusLabelMap[featureStatus]) 196 var statusInfo = statusMap[featureStatus];
173 console.log('Missing statusLabel for', featureStatus); 197 if (!statusInfo) {
174 if (!statusClassMap[featureStatus]) 198 console.log('Missing status for ', featureStatus);
175 console.log('Missing statusClass for', featureStatus); 199 statusEl.textContent = 'Unknown';
176 statusEl.textContent = statusLabelMap[featureStatus]; 200 statusEl.className = 'feature-red';
177 statusEl.className = statusClassMap[featureStatus]; 201 } else {
202 statusEl.textContent = statusInfo['label'];
203 statusEl.className = statusInfo['class'];
204 }
178 featureEl.appendChild(statusEl); 205 featureEl.appendChild(statusEl);
179 206
180 featureStatusList.appendChild(featureEl); 207 featureStatusList.appendChild(featureEl);
181 } 208 }
182 209
183 // problems list 210 // problems list
184 if (gpuInfo.featureStatus.problems.length) { 211 if (gpuInfo.featureStatus.problems.length) {
185 problemsDiv.hidden = false; 212 problemsDiv.hidden = false;
186 problemsList.textContent = ''; 213 problemsList.textContent = '';
187 for (i = 0; i < gpuInfo.featureStatus.problems.length; i++) { 214 for (i = 0; i < gpuInfo.featureStatus.problems.length; i++) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 374
348 peg.innerHTML = ''; 375 peg.innerHTML = '';
349 peg.appendChild(template); 376 peg.appendChild(template);
350 } 377 }
351 }; 378 };
352 379
353 return { 380 return {
354 InfoView: InfoView 381 InfoView: InfoView
355 }; 382 };
356 }); 383 });
OLDNEW
« no previous file with comments | « content/browser/gpu/compositor_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698