b=593850; [webgl] fix bad-arguments and null-object-behaviour tests; r=bjacob, a=b

This commit is contained in:
Vladimir Vukicevic 2010-09-13 08:57:25 -07:00
Родитель 6f7f10b1ae
Коммит da315d9714
3 изменённых файлов: 14 добавлений и 34 удалений

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

@ -150,6 +150,10 @@ WebGLContext::ActiveTexture(WebGLenum texture)
NS_IMETHODIMP
WebGLContext::AttachShader(nsIWebGLProgram *pobj, nsIWebGLShader *shobj)
{
// if pobj or shobj are null/not specified, it's an error
if (pobj == nsnull || shobj == nsnull)
return ErrorInvalidValue("attachShader");
WebGLuint progname, shadername;
WebGLProgram *program;
WebGLShader *shader;
@ -2093,14 +2097,17 @@ WebGLContext::GetTexParameter(WebGLenum target, WebGLenum pname, nsIVariant **re
{
*retval = nsnull;
nsCOMPtr<nsIWritableVariant> wrval = do_CreateInstance("@mozilla.org/variant;1");
NS_ENSURE_TRUE(wrval, NS_ERROR_FAILURE);
MakeContextCurrent();
if (!ValidateTextureTargetEnum(target, "getTexParameter: target"))
return NS_OK;
if (!activeBoundTextureForTarget(target))
return ErrorInvalidOperation("getTexParameter: no texture bound");
nsCOMPtr<nsIWritableVariant> wrval = do_CreateInstance("@mozilla.org/variant;1");
NS_ENSURE_TRUE(wrval, NS_ERROR_FAILURE);
switch (pname) {
case LOCAL_GL_TEXTURE_MIN_FILTER:
case LOCAL_GL_TEXTURE_MAG_FILTER:
@ -3148,7 +3155,6 @@ WebGLContext::CompileShader(nsIWebGLShader *sobj)
{
WebGLShader *shader;
WebGLuint shadername;
if (!GetConcreteObjectAndGLName("compileShader", sobj, &shader, &shadername))
return NS_OK;
MakeContextCurrent();

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

@ -1,7 +1,6 @@
conformance/array-buffer-crash.html
conformance/array-buffer-view-crash.html
conformance/array-unit-tests.html
conformance/bad-arguments-test.html
conformance/canvas-test.html
conformance/constants.html
conformance/context-attributes-alpha-depth-stencil-antialias.html
@ -20,7 +19,6 @@ conformance/glsl-2types-of-textures-on-same-unit.html
conformance/glsl-conformance.html
conformance/invalid-passed-params.html
conformance/methods.html
conformance/null-object-behaviour.html
conformance/point-size.html
conformance/program-test.html
conformance/read-pixels-pack-alignment.html

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

@ -132,20 +132,6 @@ interface nsIWebGLUniformLocation : nsISupports
[scriptable, uuid(2f21ca21-9720-4eee-ad94-27eefe4f72dc)]
interface nsICanvasRenderingContextWebGL : nsISupports
{
//
// ARRAY CONSTRUCTORS
//
/*
nsIWebGLFloatArray createFloatArray();
nsIWebGLByteArray createByteArray();
nsIWebGLUnsignedByteArray createUnsignedByteArray();
nsIWebGLShortArray createShortArray();
nsIWebGLUnsignedShortArray createUnsignedShortArray();
nsIWebGLIntArray createIntArray();
nsIWebGLUnsignedIntArray createUnsignedIntArray();
*/
//
// CONSTANTS
//
@ -164,16 +150,6 @@ interface nsICanvasRenderingContextWebGL : nsISupports
const unsigned long TRIANGLE_STRIP = 0x0005;
const unsigned long TRIANGLE_FAN = 0x0006;
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
const unsigned long ZERO = 0;
const unsigned long ONE = 1;
@ -583,7 +559,7 @@ interface nsICanvasRenderingContextWebGL : nsISupports
void present();
void activeTexture(in WebGLenum texture);
void attachShader(in nsIWebGLProgram program, in nsIWebGLShader shader);
void attachShader([optional] in nsIWebGLProgram program, [optional] in nsIWebGLShader shader);
void bindAttribLocation(in nsIWebGLProgram program, in WebGLuint index, in DOMString name);
void bindBuffer(in WebGLenum target, in nsIWebGLBuffer buffer);
void bindFramebuffer(in WebGLenum target, in nsIWebGLFramebuffer framebuffer);
@ -611,7 +587,7 @@ interface nsICanvasRenderingContextWebGL : nsISupports
void clearDepth(in WebGLclampf depth);
void clearStencil(in WebGLint s);
void colorMask(in WebGLboolean red, in WebGLboolean green, in WebGLboolean blue, in WebGLboolean alpha);
void compileShader(in nsIWebGLShader shader);
void compileShader([optional] in nsIWebGLShader shader);
void copyTexImage2D(in WebGLenum target, in WebGLint level, in WebGLenum internalformat,
in WebGLint x, in WebGLint y, in WebGLsizei width, in WebGLsizei height, in WebGLint border);
@ -717,7 +693,7 @@ interface nsICanvasRenderingContextWebGL : nsISupports
WebGLboolean isEnabled(in WebGLenum cap);
void lineWidth(in WebGLfloat width);
void linkProgram(in nsIWebGLProgram program);
void linkProgram([optional] in nsIWebGLProgram program);
void pixelStorei(in WebGLenum pname, in WebGLint param);
void polygonOffset(in WebGLfloat factor, in WebGLfloat units);
@ -734,7 +710,7 @@ interface nsICanvasRenderingContextWebGL : nsISupports
void scissor(in WebGLint x, in WebGLint y, in WebGLsizei width, in WebGLsizei height);
// Modified: void glShaderSource(WebGLuint shader, WebGLsizei count, const char** string, const WebGLint* length);
void shaderSource(in nsIWebGLShader shader, in DOMString source);
void shaderSource([optional] in nsIWebGLShader shader, [optional] in DOMString source);
void stencilFunc(in WebGLenum func, in WebGLint ref, in WebGLuint mask);
void stencilFuncSeparate(in WebGLenum face, in WebGLenum func, in WebGLint ref, in WebGLuint mask);