b=551771; WebGL calls broken with boolean args in loop (qsgen octet handling); also rename all WebGL types to avoid conflicts with system GL types; r=jorendroff,joe

This commit is contained in:
Vladimir Vukicevic
2010-05-28 15:52:39 -07:00
parent 6862891997
commit faabb0a990
7 changed files with 446 additions and 517 deletions

View File

@@ -237,7 +237,7 @@ nsICanvasRenderingContextWebGL_TexImage2D(JSContext *cx, uintN argc, jsval *vp)
return JS_FALSE;
}
rv = self->TexImage2D_dom(intargs[0], intargs[1], elt, (GLboolean) intargs[3], (GLboolean) intargs[4]);
rv = self->TexImage2D_dom(intargs[0], intargs[1], elt, (WebGLboolean) intargs[3], (WebGLboolean) intargs[4]);
goto check_rv_and_return;
}
}
@@ -334,7 +334,7 @@ nsICanvasRenderingContextWebGL_TexSubImage2D(JSContext *cx, uintN argc, jsval *v
if (NS_SUCCEEDED(rv)) {
rv = self->TexSubImage2D_dom(intargs[0], intargs[1], intargs[2],
intargs[2], intargs[4], intargs[5],
elt, (GLboolean) intargs[7], (GLboolean) intargs[8]);
elt, (WebGLboolean) intargs[7], (WebGLboolean) intargs[8]);
if (NS_FAILED(rv))
return xpc_qsThrowMethodFailed(cx, rv, vp);
return JS_TRUE;

View File

@@ -417,62 +417,15 @@ NS_INTERFACE_MAP_BEGIN(WebGLRenderbuffer)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLRenderbuffer)
NS_INTERFACE_MAP_END
/* [noscript] attribute GLuint name; */
NS_IMETHODIMP WebGLTexture::GetName(GLuint *aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebGLTexture::SetName(GLuint aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
#define NAME_NOT_SUPPORTED(base) \
NS_IMETHODIMP base::GetName(WebGLuint *aName) \
{ return NS_ERROR_NOT_IMPLEMENTED; } \
NS_IMETHODIMP base::SetName(WebGLuint aName) \
{ return NS_ERROR_NOT_IMPLEMENTED; }
/* [noscript] attribute GLuint name; */
NS_IMETHODIMP WebGLBuffer::GetName(GLuint *aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebGLBuffer::SetName(GLuint aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] attribute GLuint name; */
NS_IMETHODIMP WebGLProgram::GetName(GLuint *aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebGLProgram::SetName(GLuint aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] attribute GLuint name; */
NS_IMETHODIMP WebGLShader::GetName(GLuint *aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebGLShader::SetName(GLuint aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] attribute GLuint name; */
NS_IMETHODIMP WebGLFramebuffer::GetName(GLuint *aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebGLFramebuffer::SetName(GLuint aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] attribute GLuint name; */
NS_IMETHODIMP WebGLRenderbuffer::GetName(GLuint *aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebGLRenderbuffer::SetName(GLuint aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NAME_NOT_SUPPORTED(WebGLTexture)
NAME_NOT_SUPPORTED(WebGLBuffer)
NAME_NOT_SUPPORTED(WebGLProgram)
NAME_NOT_SUPPORTED(WebGLShader)
NAME_NOT_SUPPORTED(WebGLFramebuffer)
NAME_NOT_SUPPORTED(WebGLRenderbuffer)

View File

@@ -214,9 +214,9 @@ struct WebGLVertexAttribData {
{ }
WebGLObjectRefPtr<WebGLBuffer> buf;
GLuint stride;
GLuint size;
GLuint offset;
WebGLuint stride;
WebGLuint size;
WebGLuint offset;
PRBool enabled;
};
@@ -244,8 +244,8 @@ public:
NS_IMETHOD GetThebesSurface(gfxASurface **surface);
NS_IMETHOD SetIsOpaque(PRBool b) { return NS_OK; };
nsresult SynthesizeGLError(GLenum err);
nsresult SynthesizeGLError(GLenum err, const char *fmt, ...);
nsresult SynthesizeGLError(WebGLenum err);
nsresult SynthesizeGLError(WebGLenum err, const char *fmt, ...);
nsresult ErrorInvalidEnum(const char *fmt, ...);
nsresult ErrorInvalidOperation(const char *fmt, ...);
@@ -263,8 +263,8 @@ protected:
PRBool mInvalidated;
GLuint mActiveTexture;
GLenum mSynthesizedGLError;
WebGLuint mActiveTexture;
WebGLenum mSynthesizedGLError;
PRBool SafeToCreateCanvas3DContext(nsHTMLCanvasElement *canvasElement);
PRBool ValidateGL();
@@ -275,14 +275,14 @@ protected:
void MakeContextCurrent() { gl->MakeCurrent(); }
// helpers
nsresult TexImage2D_base(GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border,
GLenum format, GLenum type,
nsresult TexImage2D_base(WebGLenum target, WebGLint level, WebGLenum internalformat,
WebGLsizei width, WebGLsizei height, WebGLint border,
WebGLenum format, WebGLenum type,
void *data, PRUint32 byteLength);
nsresult TexSubImage2D_base(GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
nsresult TexSubImage2D_base(WebGLenum target, WebGLint level,
WebGLint xoffset, WebGLint yoffset,
WebGLsizei width, WebGLsizei height,
WebGLenum format, WebGLenum type,
void *pixels, PRUint32 byteLength);
nsresult DOMElementToImageSurface(nsIDOMElement *imageOrCanvas,
@@ -364,13 +364,13 @@ protected:
: mWidth(0), mHeight(0) { }
public:
GLsizei width() { return mWidth; }
void width(GLsizei value) { mWidth = value; }
WebGLsizei width() { return mWidth; }
void width(WebGLsizei value) { mWidth = value; }
GLsizei height() { return mHeight; }
void height(GLsizei value) { mHeight = value; }
WebGLsizei height() { return mHeight; }
void height(WebGLsizei value) { mHeight = value; }
void setDimensions(GLsizei width, GLsizei height) {
void setDimensions(WebGLsizei width, WebGLsizei height) {
mWidth = width;
mHeight = height;
}
@@ -386,8 +386,8 @@ public:
}
protected:
GLsizei mWidth;
GLsizei mHeight;
WebGLsizei mWidth;
WebGLsizei mHeight;
};
#define WEBGLBUFFER_PRIVATE_IID \
@@ -399,7 +399,7 @@ class WebGLBuffer :
public:
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLBUFFER_PRIVATE_IID)
WebGLBuffer(GLuint name)
WebGLBuffer(WebGLuint name)
: mName(name), mDeleted(PR_FALSE), mByteLength(0)
{ }
@@ -413,17 +413,17 @@ public:
}
PRBool Deleted() { return mDeleted; }
GLuint GLName() { return mName; }
WebGLuint GLName() { return mName; }
PRUint32 ByteLength() { return mByteLength; }
void SetByteLength(GLuint len) {
void SetByteLength(WebGLuint len) {
mByteLength = len;
}
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBGLBUFFER
protected:
GLuint mName;
WebGLuint mName;
PRBool mDeleted;
PRUint32 mByteLength;
};
@@ -440,7 +440,7 @@ class WebGLTexture :
public:
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLTEXTURE_PRIVATE_IID)
WebGLTexture(GLuint name) :
WebGLTexture(WebGLuint name) :
mName(name), mDeleted(PR_FALSE) { }
void Delete() {
@@ -451,12 +451,12 @@ public:
}
PRBool Deleted() { return mDeleted; }
GLuint GLName() { return mName; }
WebGLuint GLName() { return mName; }
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBGLTEXTURE
protected:
GLuint mName;
WebGLuint mName;
PRBool mDeleted;
};
@@ -471,7 +471,7 @@ class WebGLProgram :
public:
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLPROGRAM_PRIVATE_IID)
WebGLProgram(GLuint name) :
WebGLProgram(WebGLuint name) :
mName(name), mDeleted(PR_FALSE) { }
void Delete() {
@@ -481,12 +481,12 @@ public:
mDeleted = PR_TRUE;
}
PRBool Deleted() { return mDeleted; }
GLuint GLName() { return mName; }
WebGLuint GLName() { return mName; }
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBGLPROGRAM
protected:
GLuint mName;
WebGLuint mName;
PRBool mDeleted;
};
@@ -501,7 +501,7 @@ class WebGLShader :
public:
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLSHADER_PRIVATE_IID)
WebGLShader(GLuint name) :
WebGLShader(WebGLuint name) :
mName(name), mDeleted(PR_FALSE) { }
void Delete() {
@@ -511,12 +511,12 @@ public:
mDeleted = PR_TRUE;
}
PRBool Deleted() { return mDeleted; }
GLuint GLName() { return mName; }
WebGLuint GLName() { return mName; }
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBGLSHADER
protected:
GLuint mName;
WebGLuint mName;
PRBool mDeleted;
};
@@ -532,7 +532,7 @@ class WebGLFramebuffer :
public:
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLFRAMEBUFFER_PRIVATE_IID)
WebGLFramebuffer(GLuint name) :
WebGLFramebuffer(WebGLuint name) :
mName(name), mDeleted(PR_FALSE) { }
void Delete() {
@@ -542,12 +542,12 @@ public:
mDeleted = PR_TRUE;
}
PRBool Deleted() { return mDeleted; }
GLuint GLName() { return mName; }
WebGLuint GLName() { return mName; }
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBGLFRAMEBUFFER
protected:
GLuint mName;
WebGLuint mName;
PRBool mDeleted;
};
@@ -563,7 +563,7 @@ class WebGLRenderbuffer :
public:
NS_DECLARE_STATIC_IID_ACCESSOR(WEBGLRENDERBUFFER_PRIVATE_IID)
WebGLRenderbuffer(GLuint name) :
WebGLRenderbuffer(WebGLuint name) :
mName(name), mDeleted(PR_FALSE) { }
void Delete() {
@@ -573,12 +573,12 @@ public:
mDeleted = PR_TRUE;
}
PRBool Deleted() { return mDeleted; }
GLuint GLName() { return mName; }
WebGLuint GLName() { return mName; }
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBGLRENDERBUFFER
protected:
GLuint mName;
WebGLuint mName;
PRBool mDeleted;
};

File diff suppressed because it is too large Load Diff

View File

@@ -224,7 +224,7 @@ WebGLContext::LogMessage(const char *fmt, va_list ap)
}
nsresult
WebGLContext::SynthesizeGLError(GLenum err)
WebGLContext::SynthesizeGLError(WebGLenum err)
{
// If there is already a pending error, don't overwrite it;
// but if there isn't, then we need to check for a gl error
@@ -244,7 +244,7 @@ WebGLContext::SynthesizeGLError(GLenum err)
}
nsresult
WebGLContext::SynthesizeGLError(GLenum err, const char *fmt, ...)
WebGLContext::SynthesizeGLError(WebGLenum err, const char *fmt, ...)
{
va_list va;
va_start(va, fmt);