diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:27:13 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 20:27:13 +0000 |
commit | cadc050d692f83c44da8a386dc37ea57490a9cc9 (patch) | |
tree | a104ac3dcd7a937cc89d5842ab3d8d6ba111c598 /chrome/common/gpu_info.cc | |
parent | c9a9f64a360ea100e2dbd08859e6242e54b98d49 (diff) | |
download | chromium_src-cadc050d692f83c44da8a386dc37ea57490a9cc9.zip chromium_src-cadc050d692f83c44da8a386dc37ea57490a9cc9.tar.gz chromium_src-cadc050d692f83c44da8a386dc37ea57490a9cc9.tar.bz2 |
Updating the about:gpu to start a webgl context if one does not exist so that some gpu_info will actually exist. It does this by refreshing the page every 5 seconds until a context does exist, if necessary.
We also looked into other methods:
- synchronous call to create context, but that will hang if there are issues creating a context
- a call back, but that will also hang until we have a gpu context
- display no data and rely on the user to refresh which is somewhat unintuitive to the user
The method in this CL seemed to be the least annoying method of doing this which didn't cause the browser to hang.
BUG=none
TEST=visual
Review URL: http://codereview.chromium.org/3348007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gpu_info.cc')
-rw-r--r-- | chrome/common/gpu_info.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/common/gpu_info.cc b/chrome/common/gpu_info.cc index 4fcd6a4..9f16bdb 100644 --- a/chrome/common/gpu_info.cc +++ b/chrome/common/gpu_info.cc @@ -5,13 +5,17 @@ #include "chrome/common/gpu_info.h" GPUInfo::GPUInfo() - : vendor_id_(0), device_id_(0), driver_version_(L""), + : initialized_(false), vendor_id_(0), device_id_(0), driver_version_(L""), pixel_shader_version_(0), vertex_shader_version_(0), gl_version_(0), can_lose_context_(false) { } +bool GPUInfo::initialized() const { + return initialized_; +} + uint32 GPUInfo::vendor_id() const { return vendor_id_; } @@ -54,4 +58,5 @@ void GPUInfo::SetGraphicsInfo(uint32 vendor_id, uint32 device_id, vertex_shader_version_ = vertex_shader_version; gl_version_ = gl_version; can_lose_context_ = can_lose_context; + initialized_ = true; } |