b=539756; [webgl] remove old typed getters; r=jmuizelaar

This commit is contained in:
Vladimir Vukicevic 2010-01-22 16:50:22 -08:00
Родитель 3cdc6b0ff9
Коммит 39d08551ce
3 изменённых файлов: 0 добавлений и 245 удалений

Просмотреть файл

@ -1242,34 +1242,6 @@ WebGLContext::GetParameter(PRUint32 pname)
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetBufferParameteri(GLenum target, GLenum pname, GLint *retval)
{
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (pname) {
case LOCAL_GL_BUFFER_SIZE:
case LOCAL_GL_BUFFER_USAGE:
case LOCAL_GL_BUFFER_ACCESS:
case LOCAL_GL_BUFFER_MAPPED:
{
PRInt32 iv = 0;
gl->fGetBufferParameteriv(target, pname, (GLint*) &iv);
js.SetRetVal(iv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
{
@ -1298,43 +1270,6 @@ WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetFramebufferAttachmentParameteri(GLenum target, GLenum attachment, GLenum pname, GLint *retval)
{
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (attachment) {
case LOCAL_GL_COLOR_ATTACHMENT0:
case LOCAL_GL_DEPTH_ATTACHMENT:
case LOCAL_GL_STENCIL_ATTACHMENT:
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
switch (pname) {
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
{
PRInt32 iv = 0;
gl->fGetFramebufferAttachmentParameteriv(target, attachment, pname, (GLint*) &iv);
js.SetRetVal(iv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)
{
@ -1372,39 +1307,6 @@ WebGLContext::GetFramebufferAttachmentParameter(GLenum target, GLenum attachment
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetRenderbufferParameteri(GLenum target, GLenum pname, GLint *retval)
{
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (pname) {
case LOCAL_GL_RENDERBUFFER_WIDTH:
case LOCAL_GL_RENDERBUFFER_HEIGHT:
case LOCAL_GL_RENDERBUFFER_INTERNAL_FORMAT:
case LOCAL_GL_RENDERBUFFER_RED_SIZE:
case LOCAL_GL_RENDERBUFFER_GREEN_SIZE:
case LOCAL_GL_RENDERBUFFER_BLUE_SIZE:
case LOCAL_GL_RENDERBUFFER_ALPHA_SIZE:
case LOCAL_GL_RENDERBUFFER_DEPTH_SIZE:
case LOCAL_GL_RENDERBUFFER_STENCIL_SIZE:
{
PRInt32 iv = 0;
gl->fGetRenderbufferParameteriv(target, pname, (GLint*) &iv);
js.SetRetVal(iv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname)
{
@ -1484,45 +1386,6 @@ WebGLContext::GetError(GLenum *_retval)
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetProgrami(nsIWebGLProgram *prog, PRUint32 pname, GLint *retval)
{
if (!prog || static_cast<WebGLProgram*>(prog)->Deleted())
return ErrorMessage("%s: program is null or deleted!", __FUNCTION__);
GLuint program = static_cast<WebGLProgram*>(prog)->GLName();
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (pname) {
case LOCAL_GL_CURRENT_PROGRAM:
case LOCAL_GL_DELETE_STATUS:
case LOCAL_GL_LINK_STATUS:
case LOCAL_GL_VALIDATE_STATUS:
case LOCAL_GL_ATTACHED_SHADERS:
case LOCAL_GL_INFO_LOG_LENGTH:
case LOCAL_GL_ACTIVE_UNIFORMS:
case LOCAL_GL_ACTIVE_UNIFORM_MAX_LENGTH:
case LOCAL_GL_ACTIVE_ATTRIBUTES:
case LOCAL_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
{
PRInt32 iv = 0;
gl->fGetProgramiv(program, pname, (GLint*) &iv);
js.SetRetVal(iv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetProgramParameter(nsIWebGLProgram *prog, PRUint32 pname)
{
@ -1729,66 +1592,6 @@ WebGLContext::TexParameter()
}
#endif
/* XXX fix */
/* void getTexParameter (); */
/* GLfloat getTexParameterf (in GLenum target, in GLenum pname); */
NS_IMETHODIMP
WebGLContext::GetTexParameterf(GLenum target, GLenum pname, GLfloat *retval)
{
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (pname) {
case LOCAL_GL_TEXTURE_MIN_FILTER:
case LOCAL_GL_TEXTURE_MAG_FILTER:
case LOCAL_GL_TEXTURE_WRAP_S:
case LOCAL_GL_TEXTURE_WRAP_T:
{
float fv = 0;
gl->fGetTexParameterfv(target, pname, (GLfloat*) &fv);
js.SetRetVal(fv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetTexParameteri(GLenum target, GLenum pname, GLint *retval)
{
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (pname) {
case LOCAL_GL_TEXTURE_MIN_FILTER:
case LOCAL_GL_TEXTURE_MAG_FILTER:
case LOCAL_GL_TEXTURE_WRAP_S:
case LOCAL_GL_TEXTURE_WRAP_T:
{
PRInt32 iv = 0;
gl->fGetTexParameteriv(target, pname, (GLint*) &iv);
js.SetRetVal(iv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetTexParameter(GLenum target, GLenum pname)
{
@ -2426,40 +2229,6 @@ WebGLContext::CompileShader(nsIWebGLShader *shobj)
}
NS_IMETHODIMP
WebGLContext::GetShaderi(nsIWebGLShader *shobj, GLenum pname, GLint *_retval)
{
if (!shobj || static_cast<WebGLShader*>(shobj)->Deleted())
return ErrorMessage("%s: shader is null or deleted!", __FUNCTION__);
GLuint shader = static_cast<WebGLShader*>(shobj)->GLName();
NativeJSContext js;
if (NS_FAILED(js.error))
return js.error;
MakeContextCurrent();
switch (pname) {
case LOCAL_GL_SHADER_TYPE:
case LOCAL_GL_DELETE_STATUS:
case LOCAL_GL_COMPILE_STATUS:
case LOCAL_GL_INFO_LOG_LENGTH:
case LOCAL_GL_SHADER_SOURCE_LENGTH:
{
PRInt32 iv = 0;
gl->fGetShaderiv(shader, pname, (GLint*) &iv);
js.SetRetVal(iv);
}
break;
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetShaderParameter(nsIWebGLShader *shobj, GLenum pname)
{

Просмотреть файл

@ -681,17 +681,14 @@ interface nsICanvasRenderingContextWebGL : nsISupports
void getParameter (in GLenum pname);
// Modified: void glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GLint getBufferParameteri (in GLenum target, in GLenum pname); // XXX remove
void getBufferParameter (in GLenum target, in GLenum pname);
GLenum getError ();
// Modified: void glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
GLint getFramebufferAttachmentParameteri (in GLenum target, in GLenum attachment, in GLenum pname); // XXX remove
void getFramebufferAttachmentParameter (in GLenum target, in GLenum attachment, in GLenum pname);
// Modified: void glGetProgramiv (nsIWebGLProgram program, GLenum pname, GLint* params);
GLint getProgrami (in nsIWebGLProgram program, in GLenum pname); // XXX remove
void getProgramParameter (in nsIWebGLProgram program, in GLenum pname);
// Modified: void glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
@ -699,10 +696,8 @@ interface nsICanvasRenderingContextWebGL : nsISupports
// Modified: void glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
//nsIWebGLIntArray getRenderbufferParameteriv (in GLenum target, in GLenum pname);
GLint getRenderbufferParameteri (in GLenum target, in GLenum pname); // XXX remove
void getRenderbufferParameter (in GLenum target, in GLenum pname);
GLint getShaderi (in nsIWebGLShader shader, in GLenum pname); // XXX remove
void getShaderParameter (in nsIWebGLShader shader, in GLenum pname);
// Modified: void glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
@ -714,8 +709,6 @@ interface nsICanvasRenderingContextWebGL : nsISupports
DOMString getShaderSource (in nsIWebGLShader shader);
DOMString getString (in GLenum name);
GLfloat getTexParameterf (in GLenum target, in GLenum pname); // XXX remove
GLint getTexParameteri (in GLenum target, in GLenum pname); // XXX remove
void getTexParameter (in GLenum target, in GLenum pname);
// FIXME: This is problematic. We don't implicitly know how big the returned data buffer

Просмотреть файл

@ -452,22 +452,15 @@ members = [
'-nsICanvasRenderingContextWebGL.getActiveAttrib',
'-nsICanvasRenderingContextWebGL.getActiveUniform',
'-nsICanvasRenderingContextWebGL.getParameter',
'-nsICanvasRenderingContextWebGL.getBufferParameteri',
'-nsICanvasRenderingContextWebGL.getBufferParameter',
'-nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameteri',
'-nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameter',
'-nsICanvasRenderingContextWebGL.getRenderbufferParameteri',
'-nsICanvasRenderingContextWebGL.getRenderbufferParameter',
'-nsICanvasRenderingContextWebGL.getProgrami',
'-nsICanvasRenderingContextWebGL.getProgramParameter',
'-nsICanvasRenderingContextWebGL.texParameterf',
'-nsICanvasRenderingContextWebGL.texParameteri',
'-nsICanvasRenderingContextWebGL.getTexParameterf',
'-nsICanvasRenderingContextWebGL.getTexParameteri',
'-nsICanvasRenderingContextWebGL.getUniform',
'-nsICanvasRenderingContextWebGL.getVertexAttrib',
'-nsICanvasRenderingContextWebGL.readPixels',
'-nsICanvasRenderingContextWebGL.getShaderi',
'-nsICanvasRenderingContextWebGL.getShaderParameter',
]