diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-08 18:03:21 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-08 18:03:21 +0000 |
commit | 81f85b378c9d8c7c3e23233a78d28da785c97a9a (patch) | |
tree | bd6a621b4eea4810e101bf5bf56ced34583573fe /chrome/browser/browser_about_handler.cc | |
parent | d1fdc6f83a75e316aafef3ff0f84f30a132f08c3 (diff) | |
download | chromium_src-81f85b378c9d8c7c3e23233a78d28da785c97a9a.zip chromium_src-81f85b378c9d8c7c3e23233a78d28da785c97a9a.tar.gz chromium_src-81f85b378c9d8c7c3e23233a78d28da785c97a9a.tar.bz2 |
Relanding 61904 with missing file this time.
Original description:
Added DirectX Diagnostics information to about:gpu on Windows.
This includes the name of the GPU hardware and the driver version and release
date and some other information that might potentially also be valuable in the
GPU stats.
TEST=try
BUG=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_about_handler.cc')
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 69ad244..ad6b091 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -56,6 +56,7 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "webkit/glue/webkit_glue.h" +#include "net/base/escape.h" #ifdef CHROME_V8 #include "v8/include/v8.h" #endif @@ -793,6 +794,43 @@ std::string VersionNumberToString(uint32 value) { return base::IntToString(hi) + "." + base::IntToString(low); } +namespace { + +// Output DxDiagNode tree as HTML tables and nested HTML unordered list +// elements. +void DxDiagNodeToHTML(std::string* output, const DxDiagNode& node) { + output->append("<table>\n"); + + for (std::map<std::string, std::string>::const_iterator it = + node.values.begin(); + it != node.values.end(); + ++it) { + output->append("<tr><td><strong>"); + output->append(EscapeForHTML(it->first)); + output->append("</strong></td><td>"); + output->append(EscapeForHTML(it->second)); + output->append("</td></tr>\n"); + } + + output->append("</table>\n<ul>\n"); + + for (std::map<std::string, DxDiagNode>::const_iterator it = + node.children.begin(); + it != node.children.end(); + ++it) { + output->append("<li><strong>"); + output->append(EscapeForHTML(it->first)); + output->append("</strong>"); + + DxDiagNodeToHTML(output, it->second); + + output->append("</li>\n"); + } + + output->append("</ul>\n"); +} +} + std::string AboutGpu() { GPUInfo gpu_info = GpuProcessHost::Get()->gpu_info(); @@ -823,6 +861,12 @@ std::string AboutGpu() { gpu_info.vertex_shader_version()).c_str()); html.append("<li><strong>GL Version:</strong> "); html.append(VersionNumberToString(gpu_info.gl_version()).c_str()); + +#if defined(OS_WIN) + html.append("<li><strong>DirectX Diagnostics:</strong> "); + DxDiagNodeToHTML(&html, gpu_info.dx_diagnostics()); +#endif + html.append("</ul></body></html> "); } return html; |