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

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

Issue 1375663002: Show GpuMemoryBuffer feature in chrome://gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP on reveman comments in #9 Created 5 years, 2 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 'panel_fitting': 'Panel Fitting', 94 'panel_fitting': 'Panel Fitting',
95 'rasterization': 'Rasterization', 95 'rasterization': 'Rasterization',
96 'multiple_raster_threads': 'Multiple Raster Threads', 96 'multiple_raster_threads': 'Multiple Raster Threads',
97 }; 97 };
98 98
99 // GpuMemoryBuffer map
100 var gmbLabelMap = {
101 'native_gpu_memory_buffers': 'Native',
102 };
reveman 2015/10/16 18:37:43 Why is this not just another field in featureLabel
103
99 var statusMap = { 104 var statusMap = {
100 'disabled_software': { 105 'disabled_software': {
101 'label': 'Software only. Hardware acceleration disabled', 106 'label': 'Software only. Hardware acceleration disabled',
102 'class': 'feature-yellow' 107 'class': 'feature-yellow'
103 }, 108 },
104 'disabled_off': { 109 'disabled_off': {
105 'label': 'Disabled', 110 'label': 'Disabled',
106 'class': 'feature-red' 111 'class': 'feature-red'
107 }, 112 },
108 'disabled_off_ok': { 113 'disabled_off_ok': {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 'enabled_force_on': { 145 'enabled_force_on': {
141 'label': 'Force enabled', 146 'label': 'Force enabled',
142 'class': 'feature-green' 147 'class': 'feature-green'
143 }, 148 },
144 }; 149 };
145 150
146 // GPU info, basic 151 // GPU info, basic
147 var diagnosticsDiv = this.querySelector('.diagnostics'); 152 var diagnosticsDiv = this.querySelector('.diagnostics');
148 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading'); 153 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading');
149 var featureStatusList = this.querySelector('.feature-status-list'); 154 var featureStatusList = this.querySelector('.feature-status-list');
155 var gmbImplementationList = this.querySelector('.gmb-implementation-list') ;
150 var problemsDiv = this.querySelector('.problems-div'); 156 var problemsDiv = this.querySelector('.problems-div');
151 var problemsList = this.querySelector('.problems-list'); 157 var problemsList = this.querySelector('.problems-list');
152 var workaroundsDiv = this.querySelector('.workarounds-div'); 158 var workaroundsDiv = this.querySelector('.workarounds-div');
153 var workaroundsList = this.querySelector('.workarounds-list'); 159 var workaroundsList = this.querySelector('.workarounds-list');
154 var gpuInfo = browserBridge.gpuInfo; 160 var gpuInfo = browserBridge.gpuInfo;
155 var i; 161 var i;
156 if (gpuInfo) { 162 if (gpuInfo) {
157 // Not using jstemplate here for blacklist status because we construct 163 // Not using jstemplate here for blacklist status because we construct
158 // href from data, which jstemplate can't seem to do. 164 // href from data, which jstemplate can't seem to do.
159 if (gpuInfo.featureStatus) { 165 if (gpuInfo.featureStatus) {
(...skipping 18 matching lines...) Expand all
178 statusEl.className = 'feature-red'; 184 statusEl.className = 'feature-red';
179 } else { 185 } else {
180 statusEl.textContent = statusInfo['label']; 186 statusEl.textContent = statusInfo['label'];
181 statusEl.className = statusInfo['class']; 187 statusEl.className = statusInfo['class'];
182 } 188 }
183 featureEl.appendChild(statusEl); 189 featureEl.appendChild(statusEl);
184 190
185 featureStatusList.appendChild(featureEl); 191 featureStatusList.appendChild(featureEl);
186 } 192 }
187 193
194 // GpuMemoryBuffer Implementation list
195 gmbImplementationList.textContent = '';
196 for (var featureName in gpuInfo.featureStatus.gmbStatus) {
197 var gmbStatus =
198 gpuInfo.featureStatus.gmbStatus[featureName];
199 var featureEl = document.createElement('li');
200
201 var nameEl = document.createElement('span');
202 if (!gmbLabelMap[featureName])
203 console.log('Missing featureLabel for', featureName);
204 nameEl.textContent = gmbLabelMap[featureName] + ': ';
205 featureEl.appendChild(nameEl);
206
207 var statusEl = document.createElement('span');
208 var statusInfo = statusMap[gmbStatus];
209 if (!statusInfo) {
210 console.log('Missing status for ', gmbStatus);
211 statusEl.textContent = 'Unknown';
212 statusEl.className = 'feature-red';
213 } else {
214 statusEl.textContent = statusInfo['label'];
215 statusEl.className = statusInfo['class'];
216 }
217 featureEl.appendChild(statusEl);
218
219 gmbImplementationList.appendChild(featureEl);
220 }
221
188 // problems list 222 // problems list
189 if (gpuInfo.featureStatus.problems.length) { 223 if (gpuInfo.featureStatus.problems.length) {
190 problemsDiv.hidden = false; 224 problemsDiv.hidden = false;
191 problemsList.textContent = ''; 225 problemsList.textContent = '';
192 for (i = 0; i < gpuInfo.featureStatus.problems.length; i++) { 226 for (i = 0; i < gpuInfo.featureStatus.problems.length; i++) {
193 var problem = gpuInfo.featureStatus.problems[i]; 227 var problem = gpuInfo.featureStatus.problems[i];
194 var problemEl = this.createProblemEl_(problem); 228 var problemEl = this.createProblemEl_(problem);
195 problemsList.appendChild(problemEl); 229 problemsList.appendChild(problemEl);
196 } 230 }
197 } else { 231 } else {
198 problemsDiv.hidden = true; 232 problemsDiv.hidden = true;
199 } 233 }
200 234
201 // driver bug workarounds list 235 // driver bug workarounds list
202 if (gpuInfo.featureStatus.workarounds.length) { 236 if (gpuInfo.featureStatus.workarounds.length) {
203 workaroundsDiv.hidden = false; 237 workaroundsDiv.hidden = false;
204 workaroundsList.textContent = ''; 238 workaroundsList.textContent = '';
205 for (i = 0; i < gpuInfo.featureStatus.workarounds.length; i++) { 239 for (i = 0; i < gpuInfo.featureStatus.workarounds.length; i++) {
206 var workaroundEl = document.createElement('li'); 240 var workaroundEl = document.createElement('li');
207 workaroundEl.textContent = gpuInfo.featureStatus.workarounds[i]; 241 workaroundEl.textContent = gpuInfo.featureStatus.workarounds[i];
208 workaroundsList.appendChild(workaroundEl); 242 workaroundsList.appendChild(workaroundEl);
209 } 243 }
210 } else { 244 } else {
211 workaroundsDiv.hidden = true; 245 workaroundsDiv.hidden = true;
212 } 246 }
213 247
214 } else { 248 } else {
215 featureStatusList.textContent = ''; 249 featureStatusList.textContent = '';
250 gmbImplementationList.textContent = '';
216 problemsList.hidden = true; 251 problemsList.hidden = true;
217 workaroundsList.hidden = true; 252 workaroundsList.hidden = true;
218 } 253 }
219 if (gpuInfo.basic_info) 254 if (gpuInfo.basic_info)
220 this.setTable_('basic-info', gpuInfo.basic_info); 255 this.setTable_('basic-info', gpuInfo.basic_info);
221 else 256 else
222 this.setTable_('basic-info', []); 257 this.setTable_('basic-info', []);
223 258
224 if (gpuInfo.diagnostics) { 259 if (gpuInfo.diagnostics) {
225 diagnosticsDiv.hidden = false; 260 diagnosticsDiv.hidden = false;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 380
346 peg.innerHTML = ''; 381 peg.innerHTML = '';
347 peg.appendChild(template); 382 peg.appendChild(template);
348 } 383 }
349 }; 384 };
350 385
351 return { 386 return {
352 InfoView: InfoView 387 InfoView: InfoView
353 }; 388 };
354 }); 389 });
OLDNEW
« content/browser/gpu/compositor_util.cc ('K') | « content/browser/resources/gpu/info_view.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698