diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 17:06:12 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 17:06:12 +0000 |
commit | 0a2cadcff3a5f6e75662ed19aa5ecab7e5576d34 (patch) | |
tree | 8192fd296587440c597713899f3d91c9a317d60c /chrome/browser/browser_about_handler.cc | |
parent | 5e45686bbb4cf67e111bde33d55f936cd133b6a1 (diff) | |
download | chromium_src-0a2cadcff3a5f6e75662ed19aa5ecab7e5576d34.zip chromium_src-0a2cadcff3a5f6e75662ed19aa5ecab7e5576d34.tar.gz chromium_src-0a2cadcff3a5f6e75662ed19aa5ecab7e5576d34.tar.bz2 |
A new change for adding the about:gpu functionality. This change also adds about:gpu to about:about.
BUG=none
TEST=visual, usage
Review URL: http://codereview.chromium.org/3214007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_about_handler.cc')
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index e4ce4cf..1db52f0 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -28,6 +28,7 @@ #include "chrome/browser/chrome_thread.h" #include "chrome/browser/defaults.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" +#include "chrome/browser/gpu_process_host.h" #include "chrome/browser/labs.h" #include "chrome/browser/memory_details.h" #include "chrome/browser/metrics/histogram_synchronizer.h" @@ -42,6 +43,7 @@ #include "chrome/common/about_handler.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_version_info.h" +#include "chrome/common/gpu_info.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/pref_names.h" @@ -95,6 +97,7 @@ const char kAppCacheInternalsPath[] = "appcache-internals"; const char kCreditsPath[] = "credits"; const char kCachePath[] = "view-http-cache"; const char kDnsPath[] = "dns"; +const char kGpuPath[] = "gpu"; const char kHistogramsPath[] = "histograms"; const char kLabsPath[] = "labs"; const char kMemoryRedirectPath[] = "memory-redirect"; @@ -127,6 +130,7 @@ const char *kAllAboutPaths[] = { kCachePath, kCreditsPath, kDnsPath, + kGpuPath, kHistogramsPath, kLabsPath, kMemoryPath, @@ -824,6 +828,35 @@ std::string AboutSys(const std::string& query) { } #endif +std::string VersionNumberToString(uint32 value) { + int hi = (value >> 8) & 0xff; + int low = value & 0xff; + return base::IntToString(hi) + "." + base::IntToString(low); +} + +std::string AboutGpu() { + GPUInfo gpu_info = GpuProcessHost::Get()->gpu_info(); + + std::string html; + html.append("<html><head><title>About GPU</title></head><body>\n"); + html.append("<h2>GPU Information</h2><ul>\n"); + + html.append("<li><strong>Vendor ID:</strong> "); + html.append(base::IntToString(gpu_info.vendor_id())); + html.append("<li><strong>Device ID:</strong> "); + html.append(base::IntToString(gpu_info.device_id())); + html.append("<li><strong>Driver Version:</strong> "); + html.append(WideToASCII(gpu_info.driver_version()).c_str()); + html.append("<li><strong>Pixel Shader Version:</strong> "); + html.append(VersionNumberToString(gpu_info.pixel_shader_version()).c_str()); + html.append("<li><strong>Vertex Shader Version:</strong> "); + html.append(VersionNumberToString(gpu_info.vertex_shader_version()).c_str()); + html.append("<li><strong>GL Version:</strong> "); + html.append(VersionNumberToString(gpu_info.gl_version()).c_str()); + html.append("</ul></body></html> "); + return html; +} + // AboutSource ----------------------------------------------------------------- AboutSource::AboutSource() @@ -912,6 +945,8 @@ void AboutSource::StartDataRequest(const std::string& path_raw, } else if (path == kSysPath) { response = AboutSys(info); #endif + } else if (path == kGpuPath) { + response = AboutGpu(); } FinishDataRequest(response, request_id); |