summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-14 00:38:43 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-14 00:38:43 +0000
commit38d139d7410c8e42e731c5c58fab23d8d07b2721 (patch)
treefc3b1dba6528b6685354480990c4e11be03200e2 /ppapi
parent2c812ba0ee1bf617c72a8bcd1a26b3a8418b0b5f (diff)
downloadchromium_src-38d139d7410c8e42e731c5c58fab23d8d07b2721.zip
chromium_src-38d139d7410c8e42e731c5c58fab23d8d07b2721.tar.gz
chromium_src-38d139d7410c8e42e731c5c58fab23d8d07b2721.tar.bz2
Detect and expose loss of OpenGL context using GL_ARB_robustness.
(This CL was originally reviewed under http://codereview.chromium.org/7331020/ . The only difference is the removal of an #include from command_buffer.h that was accidentally left in and which caused a significant increase in the number of files containing static initializers, presumably because of the dependent #include of <iostream>.) This initial patch changes the Linux port to use GLX_ARB_create_context_robustness when available, and tests periodically whether the context has been lost after each draw call and when making the context current. The detection of context loss also works with EGL and ANGLE, although it always reports an unknown reset status. WebKit changes will follow which test the reset status and determine what to do in response; for example, the policy might be to never restore a WebGL context which was lost (due to a GPU reset) and which was determined to be the guilty context. Tested manually with WebGL stress tests and verified on Linux and Windows that in at least some situations it is possible to detect guilty contexts and shut down the associated WebGL application. Some precision of this detection was recently lost and will need to be fixed in following CLs. Also updated and ran GPU unit tests. BUG=88106 TEST=none (tested manually; try servers) R=gman,apatrick,piman Review URL: http://codereview.chromium.org/7362005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppb_context_3d_proxy.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_context_3d_proxy.cc b/ppapi/proxy/ppb_context_3d_proxy.cc
index d31ad29..ff2fe93 100644
--- a/ppapi/proxy/ppb_context_3d_proxy.cc
+++ b/ppapi/proxy/ppb_context_3d_proxy.cc
@@ -98,6 +98,7 @@ class PepperCommandBuffer : public gpu::CommandBuffer {
virtual gpu::Buffer GetTransferBuffer(int32 handle);
virtual void SetToken(int32 token);
virtual void SetParseError(gpu::error::Error error);
+ virtual void SetContextLostReason(gpu::error::ContextLostReason reason);
private:
bool Send(IPC::Message* msg);
@@ -308,6 +309,11 @@ void PepperCommandBuffer::SetParseError(gpu::error::Error error) {
NOTREACHED();
}
+void PepperCommandBuffer::SetContextLostReason(
+ gpu::error::ContextLostReason reason) {
+ NOTREACHED();
+}
+
bool PepperCommandBuffer::Send(IPC::Message* msg) {
DCHECK(last_state_.error == gpu::error::kNoError);