| OLD | NEW |
| 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 */ |
| 11 cr.define('gpu', function() { | 11 cr.define('gpu', function() { |
| 12 /** | 12 /** |
| 13 * Provides information on the GPU process and underlying graphics hardware. | 13 * Provides information on the GPU process and underlying graphics hardware. |
| 14 * @constructor | 14 * @constructor |
| 15 * @extends {cr.ui.TabPanel} | 15 * @extends {cr.ui.TabPanel} |
| 16 */ | 16 */ |
| 17 var InfoView = cr.ui.define(cr.ui.TabPanel); | 17 var InfoView = cr.ui.define(cr.ui.TabPanel); |
| 18 | 18 |
| 19 InfoView.prototype = { | 19 InfoView.prototype = { |
| 20 __proto__: cr.ui.TabPanel.prototype, | 20 __proto__: cr.ui.TabPanel.prototype, |
| 21 | 21 |
| 22 decorate: function() { | 22 decorate: function() { |
| 23 cr.ui.TabPanel.prototype.decorate.apply(this); | 23 cr.ui.TabPanel.prototype.decorate.apply(this); |
| 24 | 24 |
| 25 browserBridge.addEventListener('gpuInfoUpdate', this.refresh.bind(this)); | 25 browserBridge.addEventListener('gpuInfoUpdate', this.refresh.bind(this)); |
| 26 browserBridge.addEventListener('gpuMemoryBufferInfoUpdate', |
| 27 this.refresh.bind(this)); |
| 26 browserBridge.addEventListener('logMessagesChange', | 28 browserBridge.addEventListener('logMessagesChange', |
| 27 this.refresh.bind(this)); | 29 this.refresh.bind(this)); |
| 28 browserBridge.addEventListener('clientInfoChange', | 30 browserBridge.addEventListener('clientInfoChange', |
| 29 this.refresh.bind(this)); | 31 this.refresh.bind(this)); |
| 30 this.refresh(); | 32 this.refresh(); |
| 31 }, | 33 }, |
| 32 | 34 |
| 33 /** | 35 /** |
| 34 * Updates the view based on its currently known data | 36 * Updates the view based on its currently known data |
| 35 */ | 37 */ |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 147 |
| 146 // GPU info, basic | 148 // GPU info, basic |
| 147 var diagnosticsDiv = this.querySelector('.diagnostics'); | 149 var diagnosticsDiv = this.querySelector('.diagnostics'); |
| 148 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading'); | 150 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading'); |
| 149 var featureStatusList = this.querySelector('.feature-status-list'); | 151 var featureStatusList = this.querySelector('.feature-status-list'); |
| 150 var problemsDiv = this.querySelector('.problems-div'); | 152 var problemsDiv = this.querySelector('.problems-div'); |
| 151 var problemsList = this.querySelector('.problems-list'); | 153 var problemsList = this.querySelector('.problems-list'); |
| 152 var workaroundsDiv = this.querySelector('.workarounds-div'); | 154 var workaroundsDiv = this.querySelector('.workarounds-div'); |
| 153 var workaroundsList = this.querySelector('.workarounds-list'); | 155 var workaroundsList = this.querySelector('.workarounds-list'); |
| 154 var gpuInfo = browserBridge.gpuInfo; | 156 var gpuInfo = browserBridge.gpuInfo; |
| 157 var gpuMemoryBufferInfo = browserBridge.gpuMemoryBufferInfo; |
| 155 var i; | 158 var i; |
| 156 if (gpuInfo) { | 159 if (gpuInfo) { |
| 157 // Not using jstemplate here for blacklist status because we construct | 160 // Not using jstemplate here for blacklist status because we construct |
| 158 // href from data, which jstemplate can't seem to do. | 161 // href from data, which jstemplate can't seem to do. |
| 159 if (gpuInfo.featureStatus) { | 162 if (gpuInfo.featureStatus) { |
| 160 // feature status list | 163 // feature status list |
| 161 featureStatusList.textContent = ''; | 164 featureStatusList.textContent = ''; |
| 162 for (var featureName in gpuInfo.featureStatus.featureStatus) { | 165 for (var featureName in gpuInfo.featureStatus.featureStatus) { |
| 163 var featureStatus = | 166 var featureStatus = |
| 164 gpuInfo.featureStatus.featureStatus[featureName]; | 167 gpuInfo.featureStatus.featureStatus[featureName]; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 212 } |
| 210 } else { | 213 } else { |
| 211 workaroundsDiv.hidden = true; | 214 workaroundsDiv.hidden = true; |
| 212 } | 215 } |
| 213 | 216 |
| 214 } else { | 217 } else { |
| 215 featureStatusList.textContent = ''; | 218 featureStatusList.textContent = ''; |
| 216 problemsList.hidden = true; | 219 problemsList.hidden = true; |
| 217 workaroundsList.hidden = true; | 220 workaroundsList.hidden = true; |
| 218 } | 221 } |
| 222 if (gpuMemoryBufferInfo.gpu_memory_buffer_info) |
| 223 this.setTable_('gpu-memory-buffer-info', |
| 224 gpuMemoryBufferInfo.gpu_memory_buffer_info); |
| 225 else |
| 226 this.setTable_('gpu-memory-buffer-info', []); |
| 227 |
| 219 if (gpuInfo.basic_info) | 228 if (gpuInfo.basic_info) |
| 220 this.setTable_('basic-info', gpuInfo.basic_info); | 229 this.setTable_('basic-info', gpuInfo.basic_info); |
| 221 else | 230 else |
| 222 this.setTable_('basic-info', []); | 231 this.setTable_('basic-info', []); |
| 223 | 232 |
| 224 if (gpuInfo.diagnostics) { | 233 if (gpuInfo.diagnostics) { |
| 225 diagnosticsDiv.hidden = false; | 234 diagnosticsDiv.hidden = false; |
| 226 diagnosticsLoadingDiv.hidden = true; | 235 diagnosticsLoadingDiv.hidden = true; |
| 227 $('diagnostics-table').hidden = false; | 236 $('diagnostics-table').hidden = false; |
| 228 this.setTable_('diagnostics-table', gpuInfo.diagnostics); | 237 this.setTable_('diagnostics-table', gpuInfo.diagnostics); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 354 |
| 346 peg.innerHTML = ''; | 355 peg.innerHTML = ''; |
| 347 peg.appendChild(template); | 356 peg.appendChild(template); |
| 348 } | 357 } |
| 349 }; | 358 }; |
| 350 | 359 |
| 351 return { | 360 return { |
| 352 InfoView: InfoView | 361 InfoView: InfoView |
| 353 }; | 362 }; |
| 354 }); | 363 }); |
| OLD | NEW |