mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 03:19:06 +00:00
Bug 665070 - part 8: add ErrorName helper (there is no part 7 anymore) - r=jrmuizel
This commit is contained in:
parent
d92db41f6a
commit
93be0be563
@ -370,6 +370,8 @@ public:
|
||||
return ErrorInvalidEnum("%s: invalid enum value 0x%x", info, enumvalue);
|
||||
}
|
||||
nsresult ErrorOutOfMemory(const char *fmt = 0, ...);
|
||||
|
||||
const char *ErrorName(GLenum error);
|
||||
|
||||
WebGLTexture *activeBoundTextureForTarget(WebGLenum target) {
|
||||
return target == LOCAL_GL_TEXTURE_2D ? mBound2DTextures[mActiveTexture]
|
||||
|
@ -190,3 +190,24 @@ WebGLContext::ErrorOutOfMemory(const char *fmt, ...)
|
||||
return SynthesizeGLError(LOCAL_GL_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
const char *
|
||||
WebGLContext::ErrorName(GLenum error)
|
||||
{
|
||||
switch(error) {
|
||||
case LOCAL_GL_INVALID_ENUM:
|
||||
return "INVALID_ENUM";
|
||||
case LOCAL_GL_INVALID_OPERATION:
|
||||
return "INVALID_OPERATION";
|
||||
case LOCAL_GL_INVALID_VALUE:
|
||||
return "INVALID_VALUE";
|
||||
case LOCAL_GL_OUT_OF_MEMORY:
|
||||
return "OUT_OF_MEMORY";
|
||||
case LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION:
|
||||
return "INVALID_FRAMEBUFFER_OPERATION";
|
||||
case LOCAL_GL_NO_ERROR:
|
||||
return "NO_ERROR";
|
||||
default:
|
||||
NS_ABORT();
|
||||
return "[unknown WebGL error!]";
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user