From 5c6ddd0fb21889b6aaa65e075f5ad574a04d9aab Mon Sep 17 00:00:00 2001 From: "apatrick@chromium.org" Date: Fri, 8 Oct 2010 01:30:46 +0000 Subject: 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 Review URL: http://codereview.chromium.org/3547020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61904 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_about_handler.cc | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'chrome/browser/browser_about_handler.cc') 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("\n"); + + for (std::map::const_iterator it = + node.values.begin(); + it != node.values.end(); + ++it) { + output->append("\n"); + } + + output->append("
"); + output->append(EscapeForHTML(it->first)); + output->append(""); + output->append(EscapeForHTML(it->second)); + output->append("
\n\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("
  • GL Version: "); html.append(VersionNumberToString(gpu_info.gl_version()).c_str()); + +#if defined(OS_WIN) + html.append("
  • DirectX Diagnostics: "); + DxDiagNodeToHTML(&html, gpu_info.dx_diagnostics()); +#endif + html.append(" "); } return html; -- cgit v1.1