summaryrefslogtreecommitdiffstats
path: root/chrome/gpu
diff options
context:
space:
mode:
authorrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 20:27:13 +0000
committerrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 20:27:13 +0000
commitcadc050d692f83c44da8a386dc37ea57490a9cc9 (patch)
treea104ac3dcd7a937cc89d5842ab3d8d6ba111c598 /chrome/gpu
parentc9a9f64a360ea100e2dbd08859e6242e54b98d49 (diff)
downloadchromium_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/gpu')
-rw-r--r--chrome/gpu/gpu_thread.cc13
-rw-r--r--chrome/gpu/gpu_thread.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_thread.cc b/chrome/gpu/gpu_thread.cc
index 2ce492c..a949e3b 100644
--- a/chrome/gpu/gpu_thread.cc
+++ b/chrome/gpu/gpu_thread.cc
@@ -86,6 +86,8 @@ void GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
OnSynchronize)
IPC_MESSAGE_HANDLER(GpuMsg_NewRenderWidgetHostView,
OnNewRenderWidgetHostView)
+ IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo,
+ OnCollectGraphicsInfo)
IPC_END_MESSAGE_MAP_EX()
}
@@ -146,3 +148,14 @@ void GpuThread::OnNewRenderWidgetHostView(GpuNativeWindowHandle parent_window,
NOTIMPLEMENTED();
#endif
}
+
+void GpuThread::OnCollectGraphicsInfo() {
+ // Fail to establish a channel if some implementation of GL cannot be
+ // initialized.
+ GPUInfo gpu_info;
+ if (gfx::GLContext::InitializeOneOff()) {
+ gpu_info_collector::CollectGraphicsInfo(&gpu_info);
+ }
+
+ Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info));
+}
diff --git a/chrome/gpu/gpu_thread.h b/chrome/gpu/gpu_thread.h
index 76904c3..fb23d7f 100644
--- a/chrome/gpu/gpu_thread.h
+++ b/chrome/gpu/gpu_thread.h
@@ -41,6 +41,7 @@ class GpuThread : public ChildThread {
// Message handlers.
void OnEstablishChannel(int renderer_id);
void OnSynchronize();
+ void OnCollectGraphicsInfo();
void OnNewRenderWidgetHostView(GpuNativeWindowHandle parent_window,
int32 routing_id);