summaryrefslogtreecommitdiffstats
path: root/gpu/pgl/pgl.h
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 23:27:43 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 23:27:43 +0000
commit9a298ada39103abf74e423519a9ee8251bbe0555 (patch)
treefe6229f2fe75a3d844408d9051cc3fa90dfe7fa8 /gpu/pgl/pgl.h
parent49a518aabe67f9366bc23d0142493cb6508d662d (diff)
downloadchromium_src-9a298ada39103abf74e423519a9ee8251bbe0555.zip
chromium_src-9a298ada39103abf74e423519a9ee8251bbe0555.tar.gz
chromium_src-9a298ada39103abf74e423519a9ee8251bbe0555.tar.bz2
Added support for lost context recovery on the client side. None of our service side GL implementations actually report lost contexts (yet).
Added pglGetError to PGL library. pglSwapBuffers returns false on a lost context or other non-recoverable error and pglGetError reports PGL_CONTEXT_LOST. Updated demo plugins to reset their PGL contexts on context lost. Standalone plugins cannot currently recover from lost context because they don't use PGL. Added error code to NPDeviceContext3D for lost context. TEST=none BUG=none Review URL: http://codereview.chromium.org/566021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/pgl/pgl.h')
-rw-r--r--gpu/pgl/pgl.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/gpu/pgl/pgl.h b/gpu/pgl/pgl.h
index 3a7735e..ac67ec1 100644
--- a/gpu/pgl/pgl.h
+++ b/gpu/pgl/pgl.h
@@ -8,12 +8,25 @@
#include "npapi.h"
#include "npapi_extensions.h"
+#define PGL_TRUE 1
+#define PGL_FALSE 0
+
#ifdef __cplusplus
extern "C" {
#endif
typedef void* PGLContext;
-typedef bool PGLBoolean;
+typedef unsigned int PGLBoolean;
+typedef int32 PGLInt;
+
+// These are the same error codes as used by EGL.
+enum {
+ PGL_SUCCESS = 0x3000,
+ PGL_NOT_INITIALIZED = 0x3001,
+ PGL_BAD_CONTEXT = 0x3006,
+ PGL_BAD_PARAMETER = 0x300C,
+ PGL_CONTEXT_LOST = 0x300E
+};
// Initialize the PGL library. This must have completed before any other PGL
// functions are invoked.
@@ -40,6 +53,9 @@ PGLBoolean pglSwapBuffers(void);
// Destroy the given PGL context.
PGLBoolean pglDestroyContext(PGLContext pgl_context);
+// Return the current PGL error.
+PGLInt pglGetError();
+
#ifdef __cplusplus
} // extern "C"
#endif