[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

zmo at google.com zmo at google.com
Mon Feb 21 00:13:23 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit a70590083ba7be02d9e863aa78be6e24614d1403
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 28 22:20:31 2011 +0000

    2011-01-28  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            uniformN*v should generate INVALID_VALUE of the array size is not a multiple of N
            https://bugs.webkit.org/show_bug.cgi?id=53306
    
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::validateUniformMatrixParameters):
    2011-01-28  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            uniformN*v should generate INVALID_VALUE of the array size is not a multiple of N
            https://bugs.webkit.org/show_bug.cgi?id=53306
    
            * fast/canvas/webgl/gl-uniform-arrays-expected.txt:
            * fast/canvas/webgl/gl-uniform-arrays.html:
            * fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt:
            * fast/canvas/webgl/gl-uniformmatrix4fv.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76988 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 87e75bd..3bd5a1e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-28  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        uniformN*v should generate INVALID_VALUE of the array size is not a multiple of N
+        https://bugs.webkit.org/show_bug.cgi?id=53306
+
+        * fast/canvas/webgl/gl-uniform-arrays-expected.txt:
+        * fast/canvas/webgl/gl-uniform-arrays.html:
+        * fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt:
+        * fast/canvas/webgl/gl-uniformmatrix4fv.html:
+
 2011-01-28  Tom Sepez  <tsepez at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/canvas/webgl/gl-uniform-arrays-expected.txt b/LayoutTests/fast/canvas/webgl/gl-uniform-arrays-expected.txt
index e79991c..e33e1c0 100644
--- a/LayoutTests/fast/canvas/webgl/gl-uniform-arrays-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-uniform-arrays-expected.txt
@@ -29,6 +29,7 @@ PASS 1 uniform found
 PASS uniform name is 'color[0]' not 'color' as per OpenGL ES 2.0.24 section 2.10
 PASS getError was expected value: INVALID_OPERATION : should fail if there is no current program
 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size with gl.uniform2fv
+PASS getError was expected value: INVALID_VALUE : should fail with non-multiple array size with gl.uniform2fv
 PASS getError was expected value: NO_ERROR : can set an array of uniforms with gl.uniform2fv
 PASS getError was expected value: NO_ERROR : can call gl.getUniform
 PASS gl.getUniform returns the correct type.
@@ -50,6 +51,7 @@ PASS 1 uniform found
 PASS uniform name is 'color[0]' not 'color' as per OpenGL ES 2.0.24 section 2.10
 PASS getError was expected value: INVALID_OPERATION : should fail if there is no current program
 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size with gl.uniform3fv
+PASS getError was expected value: INVALID_VALUE : should fail with non-multiple array size with gl.uniform3fv
 PASS getError was expected value: NO_ERROR : can set an array of uniforms with gl.uniform3fv
 PASS getError was expected value: NO_ERROR : can call gl.getUniform
 PASS gl.getUniform returns the correct type.
@@ -71,6 +73,7 @@ PASS 1 uniform found
 PASS uniform name is 'color[0]' not 'color' as per OpenGL ES 2.0.24 section 2.10
 PASS getError was expected value: INVALID_OPERATION : should fail if there is no current program
 PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size with gl.uniform4fv
+PASS getError was expected value: INVALID_VALUE : should fail with non-multiple array size with gl.uniform4fv
 PASS getError was expected value: NO_ERROR : can set an array of uniforms with gl.uniform4fv
 PASS getError was expected value: NO_ERROR : can call gl.getUniform
 PASS gl.getUniform returns the correct type.
diff --git a/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html b/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
index bdd4434..226de37 100644
--- a/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
+++ b/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
@@ -109,7 +109,8 @@ var typeInfos = [
       return typeInfo.srcValues[index] == value;
     },
     srcValues: [16, 15, 14],
-    srcValuesBad: [],
+    srcValuesLess: [],
+    srcValuesNonMultiple: null,
   },
   { type: 'vec2',
     jsTypeOf: 'Float32Array',
@@ -140,7 +141,8 @@ var typeInfos = [
              typeInfo.srcValues[index * 2 + 1] == value[1];
     },
     srcValues: [16, 15, 14, 13, 12, 11],
-    srcValuesBad: [16],
+    srcValuesLess: [16],
+    srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10],
   },
   { type: 'vec3',
     jsTypeOf: 'Float32Array',
@@ -174,7 +176,8 @@ var typeInfos = [
              typeInfo.srcValues[index * 3 + 2] == value[2];
     },
     srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8],
-    srcValuesBad: [16, 15],
+    srcValuesLess: [16, 15],
+    srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7],
   },
   { type: 'vec4',
     jsTypeOf: 'Float32Array',
@@ -211,7 +214,8 @@ var typeInfos = [
              typeInfo.srcValues[index * 4 + 3] == value[3];
     },
     srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5],
-    srcValuesBad: [16, 15, 14],
+    srcValuesLess: [16, 15, 14],
+    srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4],
   }
 ];
 
@@ -231,33 +235,39 @@ for (var tt = 0; tt < typeInfos.length; ++tt) {
             "uniform name is 'color[0]' not 'color' as per OpenGL ES 2.0.24 section 2.10");
   var loc = gl.getUniformLocation(program, "color[0]");
   var srcValues = typeInfo.srcValues;
-  var srcValuesBad = typeInfo.srcValuesBad;
+  var srcValuesLess = typeInfo.srcValuesLess;
+  var srcValuesNonMultiple = typeInfo.srcValuesNonMultiple;
 
   // Try setting the value before using the program
   gl[typeInfo.setter](loc, srcValues);
   glErrorShouldBe(gl, gl.INVALID_OPERATION,
-            "should fail if there is no current program");
+                  "should fail if there is no current program");
 
   gl.useProgram(program);
-  gl[typeInfo.setter](loc, srcValuesBad);
+  gl[typeInfo.setter](loc, srcValuesLess);
   glErrorShouldBe(gl, gl.INVALID_VALUE,
-            "should fail with insufficient array size with gl." + typeInfo.setter);
+                  "should fail with insufficient array size with gl." + typeInfo.setter);
+  if (srcValuesNonMultiple) {
+    gl[typeInfo.setter](loc, srcValuesNonMultiple);
+    glErrorShouldBe(gl, gl.INVALID_VALUE,
+                    "should fail with non-multiple array size with gl." + typeInfo.setter);
+  }
   gl[typeInfo.setter](loc, srcValues);
   glErrorShouldBe(gl, gl.NO_ERROR,
-            "can set an array of uniforms with gl." + typeInfo.setter);
+                  "can set an array of uniforms with gl." + typeInfo.setter);
   var values = gl.getUniform(program, loc);
   glErrorShouldBe(gl, gl.NO_ERROR,
-            "can call gl.getUniform");
+                  "can call gl.getUniform");
   assertMsg(typeInfo.checkType(values),
             "gl.getUniform returns the correct type.");
   for (var ii = 0; ii < typeInfo.numSrcValues; ++ii) {
     var elemLoc = gl.getUniformLocation(program, "color[" + ii + "]");
     glErrorShouldBe(gl, gl.NO_ERROR,
-              "can get location of element " + ii +
-              " of array from gl.getUniformLocation");
+                    "can get location of element " + ii +
+                    " of array from gl.getUniformLocation");
     var value = gl.getUniform(program, elemLoc);
     glErrorShouldBe(gl, gl.NO_ERROR,
-              "can get value of element " + ii + " of array from gl.getUniform");
+                    "can get value of element " + ii + " of array from gl.getUniform");
     assertMsg(typeInfo.checkValue(typeInfo, ii, value),
               "value put in (" + typeInfo.srcValueAsString(ii, srcValues) +
               ") matches value pulled out (" +
@@ -265,7 +275,7 @@ for (var tt = 0; tt < typeInfos.length; ++tt) {
   }
   typeInfo.invalidSet(loc);
   glErrorShouldBe(gl, gl.INVALID_OPERATION,
-            "using the wrong size of gl.Uniform fails");
+                  "using the wrong size of gl.Uniform fails");
   var exceptionCaught = false;
   if (typeInfo.illegalSet) {
     try {
@@ -278,7 +288,7 @@ for (var tt = 0; tt < typeInfos.length; ++tt) {
 
   gl.useProgram(null);
   glErrorShouldBe(gl, gl.NO_ERROR,
-            "can call gl.useProgram(null)");
+                  "can call gl.useProgram(null)");
 }
 debug("");
 successfullyParsed = true;
diff --git a/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt b/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt
index 03ff5c4..23c1b4c 100644
--- a/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt
@@ -4,15 +4,21 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 Checking gl.uniformMatrix.
-PASS should fail with insufficient array size for uniformMatrix2fv
-PASS can call uniformMatrix2fvwith transpose = false
-PASS uniformMatrix2fv should return INVALID_VALUE with transpose = true
-PASS should fail with insufficient array size for uniformMatrix3fv
-PASS can call uniformMatrix3fvwith transpose = false
-PASS uniformMatrix3fv should return INVALID_VALUE with transpose = true
-PASS should fail with insufficient array size for uniformMatrix4fv
-PASS can call uniformMatrix4fvwith transpose = false
-PASS uniformMatrix4fv should return INVALID_VALUE with transpose = true
+PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size for uniformMatrix2fv
+PASS getError was expected value: NO_ERROR : should succeed with correct array size for uniformMatrix2fv
+PASS getError was expected value: INVALID_VALUE : should fail with more than 1 array size for uniformMatrix2fv
+PASS getError was expected value: NO_ERROR : can call uniformMatrix2fvwith transpose = false
+PASS getError was expected value: INVALID_VALUE : uniformMatrix2fv should return INVALID_VALUE with transpose = true
+PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size for uniformMatrix3fv
+PASS getError was expected value: NO_ERROR : should succeed with correct array size for uniformMatrix3fv
+PASS getError was expected value: INVALID_VALUE : should fail with more than 1 array size for uniformMatrix3fv
+PASS getError was expected value: NO_ERROR : can call uniformMatrix3fvwith transpose = false
+PASS getError was expected value: INVALID_VALUE : uniformMatrix3fv should return INVALID_VALUE with transpose = true
+PASS getError was expected value: INVALID_VALUE : should fail with insufficient array size for uniformMatrix4fv
+PASS getError was expected value: NO_ERROR : should succeed with correct array size for uniformMatrix4fv
+PASS getError was expected value: INVALID_VALUE : should fail with more than 1 array size for uniformMatrix4fv
+PASS getError was expected value: NO_ERROR : can call uniformMatrix4fvwith transpose = false
+PASS getError was expected value: INVALID_VALUE : uniformMatrix4fv should return INVALID_VALUE with transpose = true
 
 PASS successfullyParsed is true
 
diff --git a/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html b/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
index 3eb7a24..c568a17 100644
--- a/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
+++ b/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
@@ -40,22 +40,29 @@ debug("Checking gl.uniformMatrix.");
 gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
 for (var ii = 2; ii <= 4; ++ii) {
   var loc = gl.getUniformLocation(gl.program, "world" + ii);
-  var mat = [];
+  var matLess = [];
   for (var jj = 0; jj < ii; ++jj) {
     for (var ll = 0; ll < ii; ++ll) {
       if (jj == ii - 1 && ll == ii - 1)
         continue;
-      mat[jj * ii + ll] = (jj == ll) ? 1 : 0;
+      matLess[jj * ii + ll] = (jj == ll) ? 1 : 0;
     }
   }
+  var mat = matLess.concat([1]);
+  var matMore = mat.concat([1]);
   name = "uniformMatrix" + ii + "fv";
+  gl[name](loc, false, matLess);
+  glErrorShouldBe(gl, gl.INVALID_VALUE, "should fail with insufficient array size for " + name);
   gl[name](loc, false, mat);
-  assertMsg(gl.getError() == gl.INVALID_VALUE, "should fail with insufficient array size for " + name);
+  glErrorShouldBe(gl, gl.NO_ERROR, "should succeed with correct array size for " + name);
+  gl[name](loc, false, matMore);
+  glErrorShouldBe(gl, gl.INVALID_VALUE, "should fail with more than 1 array size for " + name);
+
   mat[ii * ii - 1] = 1;
   gl[name](loc, false, mat);
-  assertMsg(gl.getError() == gl.NO_ERROR, "can call " + name + "with transpose = false");
+  glErrorShouldBe(gl, gl.NO_ERROR, "can call " + name + "with transpose = false");
   gl[name](loc, true, mat);
-  assertMsg(gl.getError() == gl.INVALID_VALUE, name + " should return INVALID_VALUE with transpose = true");
+  glErrorShouldBe(gl, gl.INVALID_VALUE, name + " should return INVALID_VALUE with transpose = true");
 }
 
 debug("");
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 67a1e82..a72509c 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-28  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        uniformN*v should generate INVALID_VALUE of the array size is not a multiple of N
+        https://bugs.webkit.org/show_bug.cgi?id=53306
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::validateUniformMatrixParameters):
+
 2011-01-28  Tom Sepez  <tsepez at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index 57ab00f..10ec7e3 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -4390,7 +4390,7 @@ bool WebGLRenderingContext::validateUniformMatrixParameters(const WebGLUniformLo
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
         return false;
     }
-    if (size < requiredMinSize) {
+    if (size < requiredMinSize || (size % requiredMinSize)) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
         return false;
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list