| 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)); | |
| 28 browserBridge.addEventListener('logMessagesChange', | 26 browserBridge.addEventListener('logMessagesChange', |
| 29 this.refresh.bind(this)); | 27 this.refresh.bind(this)); |
| 30 browserBridge.addEventListener('clientInfoChange', | 28 browserBridge.addEventListener('clientInfoChange', |
| 31 this.refresh.bind(this)); | 29 this.refresh.bind(this)); |
| 32 this.refresh(); | 30 this.refresh(); |
| 33 }, | 31 }, |
| 34 | 32 |
| 35 /** | 33 /** |
| 36 * Updates the view based on its currently known data | 34 * Updates the view based on its currently known data |
| 37 */ | 35 */ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 'multisampling': 'WebGL multisampling', | 87 'multisampling': 'WebGL multisampling', |
| 90 'flash_3d': 'Flash', | 88 'flash_3d': 'Flash', |
| 91 'flash_stage3d': 'Flash Stage3D', | 89 'flash_stage3d': 'Flash Stage3D', |
| 92 'flash_stage3d_baseline': 'Flash Stage3D Baseline profile', | 90 'flash_stage3d_baseline': 'Flash Stage3D Baseline profile', |
| 93 'texture_sharing': 'Texture Sharing', | 91 'texture_sharing': 'Texture Sharing', |
| 94 'video_decode': 'Video Decode', | 92 'video_decode': 'Video Decode', |
| 95 'video_encode': 'Video Encode', | 93 'video_encode': 'Video Encode', |
| 96 'panel_fitting': 'Panel Fitting', | 94 'panel_fitting': 'Panel Fitting', |
| 97 'rasterization': 'Rasterization', | 95 'rasterization': 'Rasterization', |
| 98 'multiple_raster_threads': 'Multiple Raster Threads', | 96 'multiple_raster_threads': 'Multiple Raster Threads', |
| 97 'native_gpu_memory_buffers': 'Native GpuMemoryBuffers', |
| 99 }; | 98 }; |
| 100 | 99 |
| 101 var statusMap = { | 100 var statusMap = { |
| 102 'disabled_software': { | 101 'disabled_software': { |
| 103 'label': 'Software only. Hardware acceleration disabled', | 102 'label': 'Software only. Hardware acceleration disabled', |
| 104 'class': 'feature-yellow' | 103 'class': 'feature-yellow' |
| 105 }, | 104 }, |
| 106 'disabled_off': { | 105 'disabled_off': { |
| 107 'label': 'Disabled', | 106 'label': 'Disabled', |
| 108 'class': 'feature-red' | 107 'class': 'feature-red' |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 146 |
| 148 // GPU info, basic | 147 // GPU info, basic |
| 149 var diagnosticsDiv = this.querySelector('.diagnostics'); | 148 var diagnosticsDiv = this.querySelector('.diagnostics'); |
| 150 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading'); | 149 var diagnosticsLoadingDiv = this.querySelector('.diagnostics-loading'); |
| 151 var featureStatusList = this.querySelector('.feature-status-list'); | 150 var featureStatusList = this.querySelector('.feature-status-list'); |
| 152 var problemsDiv = this.querySelector('.problems-div'); | 151 var problemsDiv = this.querySelector('.problems-div'); |
| 153 var problemsList = this.querySelector('.problems-list'); | 152 var problemsList = this.querySelector('.problems-list'); |
| 154 var workaroundsDiv = this.querySelector('.workarounds-div'); | 153 var workaroundsDiv = this.querySelector('.workarounds-div'); |
| 155 var workaroundsList = this.querySelector('.workarounds-list'); | 154 var workaroundsList = this.querySelector('.workarounds-list'); |
| 156 var gpuInfo = browserBridge.gpuInfo; | 155 var gpuInfo = browserBridge.gpuInfo; |
| 157 var gpuMemoryBufferInfo = browserBridge.gpuMemoryBufferInfo; | |
| 158 var i; | 156 var i; |
| 159 if (gpuInfo) { | 157 if (gpuInfo) { |
| 160 // Not using jstemplate here for blacklist status because we construct | 158 // Not using jstemplate here for blacklist status because we construct |
| 161 // href from data, which jstemplate can't seem to do. | 159 // href from data, which jstemplate can't seem to do. |
| 162 if (gpuInfo.featureStatus) { | 160 if (gpuInfo.featureStatus) { |
| 163 // feature status list | 161 // feature status list |
| 164 featureStatusList.textContent = ''; | 162 featureStatusList.textContent = ''; |
| 165 for (var featureName in gpuInfo.featureStatus.featureStatus) { | 163 for (var featureName in gpuInfo.featureStatus.featureStatus) { |
| 166 var featureStatus = | 164 var featureStatus = |
| 167 gpuInfo.featureStatus.featureStatus[featureName]; | 165 gpuInfo.featureStatus.featureStatus[featureName]; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 210 } |
| 213 } else { | 211 } else { |
| 214 workaroundsDiv.hidden = true; | 212 workaroundsDiv.hidden = true; |
| 215 } | 213 } |
| 216 | 214 |
| 217 } else { | 215 } else { |
| 218 featureStatusList.textContent = ''; | 216 featureStatusList.textContent = ''; |
| 219 problemsList.hidden = true; | 217 problemsList.hidden = true; |
| 220 workaroundsList.hidden = true; | 218 workaroundsList.hidden = true; |
| 221 } | 219 } |
| 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 | 220 |
| 228 if (gpuInfo.basic_info) | 221 if (gpuInfo.basic_info) |
| 229 this.setTable_('basic-info', gpuInfo.basic_info); | 222 this.setTable_('basic-info', gpuInfo.basic_info); |
| 230 else | 223 else |
| 231 this.setTable_('basic-info', []); | 224 this.setTable_('basic-info', []); |
| 232 | 225 |
| 226 if (gpuInfo.compositorInfo) |
| 227 this.setTable_('compositor-info', gpuInfo.compositorInfo); |
| 228 else |
| 229 this.setTable_('compositor-info', []); |
| 230 |
| 231 if (gpuInfo.gpuMemoryBufferInfo) |
| 232 this.setTable_('gpu-memory-buffer-info', gpuInfo.gpuMemoryBufferInfo); |
| 233 else |
| 234 this.setTable_('gpu-memory-buffer-info', []); |
| 235 |
| 233 if (gpuInfo.diagnostics) { | 236 if (gpuInfo.diagnostics) { |
| 234 diagnosticsDiv.hidden = false; | 237 diagnosticsDiv.hidden = false; |
| 235 diagnosticsLoadingDiv.hidden = true; | 238 diagnosticsLoadingDiv.hidden = true; |
| 236 $('diagnostics-table').hidden = false; | 239 $('diagnostics-table').hidden = false; |
| 237 this.setTable_('diagnostics-table', gpuInfo.diagnostics); | 240 this.setTable_('diagnostics-table', gpuInfo.diagnostics); |
| 238 } else if (gpuInfo.diagnostics === null) { | 241 } else if (gpuInfo.diagnostics === null) { |
| 239 // gpu_internals.cc sets diagnostics to null when it is being loaded | 242 // gpu_internals.cc sets diagnostics to null when it is being loaded |
| 240 diagnosticsDiv.hidden = false; | 243 diagnosticsDiv.hidden = false; |
| 241 diagnosticsLoadingDiv.hidden = false; | 244 diagnosticsLoadingDiv.hidden = false; |
| 242 $('diagnostics-table').hidden = true; | 245 $('diagnostics-table').hidden = true; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 357 |
| 355 peg.innerHTML = ''; | 358 peg.innerHTML = ''; |
| 356 peg.appendChild(template); | 359 peg.appendChild(template); |
| 357 } | 360 } |
| 358 }; | 361 }; |
| 359 | 362 |
| 360 return { | 363 return { |
| 361 InfoView: InfoView | 364 InfoView: InfoView |
| 362 }; | 365 }; |
| 363 }); | 366 }); |
| OLD | NEW |