| Index: chrome/browser/resources/gpu_internals/info_view.js
|
| diff --git a/chrome/browser/resources/gpu_internals/info_view.js b/chrome/browser/resources/gpu_internals/info_view.js
|
| index d4d5ff7976b456de2f5491a1af0f5b35834dd9be..92c51c3b3ac99d086fcc291a2cd29305b4b0b92d 100644
|
| --- a/chrome/browser/resources/gpu_internals/info_view.js
|
| +++ b/chrome/browser/resources/gpu_internals/info_view.js
|
| @@ -90,71 +90,54 @@ cr.define('gpu', function() {
|
|
|
| // GPU info, basic
|
| var diagnostics = this.querySelector('.diagnostics');
|
| - var blacklistedIndicator = this.querySelector('.blacklisted-indicator');
|
| + var featureStatusList = this.querySelector('.feature-status-list');
|
| + var problemsDiv = this.querySelector('.problems-div');
|
| + var problemsList = this.querySelector('.problems-list');
|
| var gpuInfo = browserBridge.gpuInfo;
|
| + var i;
|
| if (gpuInfo) {
|
| - if (gpuInfo.blacklistingReasons) {
|
| - blacklistedIndicator.hidden = false;
|
| - // Not using jstemplate here because we need to manipulate
|
| - // href on the fly
|
| - var reasonsEl = blacklistedIndicator.querySelector(
|
| - '.blacklisted-reasons');
|
| - reasonsEl.textContent = '';
|
| - for (var i = 0; i < gpuInfo.blacklistingReasons.length; i++) {
|
| - var reason = gpuInfo.blacklistingReasons[i];
|
| -
|
| - var reasonEl = document.createElement('li');
|
| -
|
| - // Description of issue
|
| - var desc = document.createElement('a');
|
| - desc.textContent = reason.description;
|
| - reasonEl.appendChild(desc);
|
| -
|
| - // Spacing ':' element
|
| - if (reason.cr_bugs.length + reason.webkit_bugs.length > 0) {
|
| - var tmp = document.createElement('span');
|
| - tmp.textContent = ' ';
|
| - reasonEl.appendChild(tmp);
|
| - }
|
| -
|
| - var nreasons = 0;
|
| - var j;
|
| - // cr_bugs
|
| - for (j = 0; j < reason.cr_bugs.length; ++j) {
|
| - if (nreasons > 0) {
|
| - var tmp = document.createElement('span');
|
| - tmp.textContent = ', ';
|
| - reasonEl.appendChild(tmp);
|
| - }
|
| -
|
| - var link = document.createElement('a');
|
| - var bugid = parseInt(reason.cr_bugs[j]);
|
| - link.textContent = bugid;
|
| - link.href = 'http://crbug.com/' + bugid;
|
| - reasonEl.appendChild(link);
|
| - nreasons++;
|
| - }
|
| -
|
| - for (j = 0; j < reason.webkit_bugs.length; ++j) {
|
| - if (nreasons > 0) {
|
| - var tmp = document.createElement('span');
|
| - tmp.textContent = ', ';
|
| - reasonEl.appendChild(tmp);
|
| - }
|
| -
|
| - var link = document.createElement('a');
|
| - var bugid = parseInt(reason.webkit_bugs[j]);
|
| - link.textContent = bugid;
|
| + // Not using jstemplate here for blacklist status because we construct
|
| + // href from data, which jstemplate can't seem to do.
|
| + if (gpuInfo.blacklistStatus) {
|
| + console.log(JSON.stringify(gpuInfo.blacklistStatus));
|
| + // feature status list
|
| + featureStatusList.textContent = '';
|
| + for (i = 0; i < gpuInfo.blacklistStatus.featureStatus.length;
|
| + i++) {
|
| + var feature = gpuInfo.blacklistStatus.featureStatus[i];
|
| + var featureEl = document.createElement('li');
|
| +
|
| + var nameEl = document.createElement('span');
|
| + nameEl.textContent = feature.name + ': ';
|
| + featureEl.appendChild(nameEl);
|
| +
|
| + var statusEl = document.createElement('span');
|
| + statusEl.textContent = feature.enabled ? 'enabled' : 'disabled';
|
| + if (feature.enabled)
|
| + statusEl.className = 'feature-enabled';
|
| + else
|
| + statusEl.className = 'feature-disabled';
|
| + featureEl.appendChild(statusEl);
|
| +
|
| + featureStatusList.appendChild(featureEl);
|
| + }
|
|
|
| - link.href = 'https://bugs.webkit.org/show_bug.cgi?id=' + bugid;
|
| - reasonEl.appendChild(link);
|
| - nreasons++;
|
| + // problems list
|
| + if (gpuInfo.blacklistStatus.problems.length) {
|
| + problemsDiv.hidden = false;
|
| + problemsList.textContent = '';
|
| + for (i = 0; i < gpuInfo.blacklistStatus.problems.length; i++) {
|
| + var problem = gpuInfo.blacklistStatus.problems[i];
|
| + var problemEl = this.createProblemEl_(problem);
|
| + problemsList.appendChild(problemEl);
|
| }
|
| -
|
| - reasonsEl.appendChild(reasonEl);
|
| + } else {
|
| + problemsDiv.hidden = true;
|
| }
|
| +
|
| } else {
|
| - blacklistedIndicator.hidden = true;
|
| + featureStatusList.textContent = '';
|
| + problemsList.hidden = true;
|
| }
|
| this.setTable_('basic-info', gpuInfo.basic_info);
|
|
|
| @@ -165,9 +148,10 @@ cr.define('gpu', function() {
|
| diagnostics.hidden = true;
|
| }
|
| } else {
|
| - blacklistedIndicator.hidden = true;
|
| this.setText_('basic-info', '... loading ...');
|
| diagnostics.hidden = true;
|
| + featureStatusList.textContent = '';
|
| + problemsDiv.hidden = true;
|
| }
|
|
|
| // Log messages
|
| @@ -177,6 +161,60 @@ cr.define('gpu', function() {
|
| }
|
| },
|
|
|
| + createProblemEl_: function(problem) {
|
| + var problemEl;
|
| + problemEl = document.createElement('li');
|
| +
|
| + // Description of issue
|
| + var desc = document.createElement('a');
|
| + desc.textContent = problem.description;
|
| + problemEl.appendChild(desc);
|
| +
|
| + // Spacing ':' element
|
| + if (problem.crBugs.length + problem.webkitBugs.length > 0) {
|
| + var tmp = document.createElement('span');
|
| + tmp.textContent = ' ';
|
| + problemEl.appendChild(tmp);
|
| + }
|
| +
|
| + var nbugs = 0;
|
| + var j;
|
| +
|
| + // crBugs
|
| + for (j = 0; j < problem.crBugs.length; ++j) {
|
| + if (nbugs > 0) {
|
| + var tmp = document.createElement('span');
|
| + tmp.textContent = ', ';
|
| + problemEl.appendChild(tmp);
|
| + }
|
| +
|
| + var link = document.createElement('a');
|
| + var bugid = parseInt(problem.crBugs[j]);
|
| + link.textContent = bugid;
|
| + link.href = 'http://crbug.com/' + bugid;
|
| + problemEl.appendChild(link);
|
| + nbugs++;
|
| + }
|
| +
|
| + for (j = 0; j < problem.webkitBugs.length; ++j) {
|
| + if (nbugs > 0) {
|
| + var tmp = document.createElement('span');
|
| + tmp.textContent = ', ';
|
| + problemEl.appendChild(tmp);
|
| + }
|
| +
|
| + var link = document.createElement('a');
|
| + var bugid = parseInt(problem.webkitBugs[j]);
|
| + link.textContent = bugid;
|
| +
|
| + link.href = 'https://bugs.webkit.org/show_bug.cgi?id=' + bugid;
|
| + problemEl.appendChild(link);
|
| + nbugs++;
|
| + }
|
| +
|
| + return problemEl;
|
| + },
|
| +
|
| setText_: function(outputElementId, text) {
|
| var peg = document.getElementById(outputElementId);
|
| peg.innerText = text;
|
|
|