зеркало из https://github.com/mozilla/gecko-dev.git
b=539756; [webgl] remove old typed getters; r=jmuizelaar
This commit is contained in:
Родитель
befc4d461f
Коммит
b9734b7d34
|
@ -1242,34 +1242,6 @@ WebGLContext::GetParameter(PRUint32 pname)
|
||||||
return NS_OK;
|
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
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
|
WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
|
||||||
{
|
{
|
||||||
|
@ -1298,43 +1270,6 @@ WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
|
||||||
return NS_OK;
|
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
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)
|
WebGLContext::GetFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)
|
||||||
{
|
{
|
||||||
|
@ -1372,39 +1307,6 @@ WebGLContext::GetFramebufferAttachmentParameter(GLenum target, GLenum attachment
|
||||||
return NS_OK;
|
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
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname)
|
WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname)
|
||||||
{
|
{
|
||||||
|
@ -1484,45 +1386,6 @@ WebGLContext::GetError(GLenum *_retval)
|
||||||
return NS_OK;
|
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
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetProgramParameter(nsIWebGLProgram *prog, PRUint32 pname)
|
WebGLContext::GetProgramParameter(nsIWebGLProgram *prog, PRUint32 pname)
|
||||||
{
|
{
|
||||||
|
@ -1729,66 +1592,6 @@ WebGLContext::TexParameter()
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetTexParameter(GLenum target, GLenum pname)
|
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
|
NS_IMETHODIMP
|
||||||
WebGLContext::GetShaderParameter(nsIWebGLShader *shobj, GLenum pname)
|
WebGLContext::GetShaderParameter(nsIWebGLShader *shobj, GLenum pname)
|
||||||
{
|
{
|
||||||
|
|
|
@ -681,17 +681,14 @@ interface nsICanvasRenderingContextWebGL : nsISupports
|
||||||
void getParameter (in GLenum pname);
|
void getParameter (in GLenum pname);
|
||||||
|
|
||||||
// Modified: void glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
// 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);
|
void getBufferParameter (in GLenum target, in GLenum pname);
|
||||||
|
|
||||||
GLenum getError ();
|
GLenum getError ();
|
||||||
|
|
||||||
// Modified: void glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
// 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);
|
void getFramebufferAttachmentParameter (in GLenum target, in GLenum attachment, in GLenum pname);
|
||||||
|
|
||||||
// Modified: void glGetProgramiv (nsIWebGLProgram program, GLenum pname, GLint* params);
|
// 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);
|
void getProgramParameter (in nsIWebGLProgram program, in GLenum pname);
|
||||||
|
|
||||||
// Modified: void glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
|
// 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);
|
// Modified: void glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
||||||
//nsIWebGLIntArray getRenderbufferParameteriv (in GLenum target, in GLenum pname);
|
//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);
|
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);
|
void getShaderParameter (in nsIWebGLShader shader, in GLenum pname);
|
||||||
|
|
||||||
// Modified: void glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
|
// Modified: void glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
|
||||||
|
@ -714,8 +709,6 @@ interface nsICanvasRenderingContextWebGL : nsISupports
|
||||||
DOMString getShaderSource (in nsIWebGLShader shader);
|
DOMString getShaderSource (in nsIWebGLShader shader);
|
||||||
DOMString getString (in GLenum name);
|
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);
|
void getTexParameter (in GLenum target, in GLenum pname);
|
||||||
|
|
||||||
// FIXME: This is problematic. We don't implicitly know how big the returned data buffer
|
// FIXME: This is problematic. We don't implicitly know how big the returned data buffer
|
||||||
|
|
|
@ -452,22 +452,15 @@ members = [
|
||||||
'-nsICanvasRenderingContextWebGL.getActiveAttrib',
|
'-nsICanvasRenderingContextWebGL.getActiveAttrib',
|
||||||
'-nsICanvasRenderingContextWebGL.getActiveUniform',
|
'-nsICanvasRenderingContextWebGL.getActiveUniform',
|
||||||
'-nsICanvasRenderingContextWebGL.getParameter',
|
'-nsICanvasRenderingContextWebGL.getParameter',
|
||||||
'-nsICanvasRenderingContextWebGL.getBufferParameteri',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getBufferParameter',
|
'-nsICanvasRenderingContextWebGL.getBufferParameter',
|
||||||
'-nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameteri',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameter',
|
'-nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameter',
|
||||||
'-nsICanvasRenderingContextWebGL.getRenderbufferParameteri',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getRenderbufferParameter',
|
'-nsICanvasRenderingContextWebGL.getRenderbufferParameter',
|
||||||
'-nsICanvasRenderingContextWebGL.getProgrami',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getProgramParameter',
|
'-nsICanvasRenderingContextWebGL.getProgramParameter',
|
||||||
'-nsICanvasRenderingContextWebGL.texParameterf',
|
'-nsICanvasRenderingContextWebGL.texParameterf',
|
||||||
'-nsICanvasRenderingContextWebGL.texParameteri',
|
'-nsICanvasRenderingContextWebGL.texParameteri',
|
||||||
'-nsICanvasRenderingContextWebGL.getTexParameterf',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getTexParameteri',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getUniform',
|
'-nsICanvasRenderingContextWebGL.getUniform',
|
||||||
'-nsICanvasRenderingContextWebGL.getVertexAttrib',
|
'-nsICanvasRenderingContextWebGL.getVertexAttrib',
|
||||||
'-nsICanvasRenderingContextWebGL.readPixels',
|
'-nsICanvasRenderingContextWebGL.readPixels',
|
||||||
'-nsICanvasRenderingContextWebGL.getShaderi',
|
|
||||||
'-nsICanvasRenderingContextWebGL.getShaderParameter',
|
'-nsICanvasRenderingContextWebGL.getShaderParameter',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче