Reviewed by Eric Seidel.
drawElements should raise INVALID_OPERATION if offset is not a multiple of the type size
https://bugs.webkit.org/show_bug.cgi?id=51726
* fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt:
* fast/canvas/webgl/draw-elements-out-of-bounds.html: Add test cases to verify the behavior.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-12-29 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Eric Seidel.
+
+ drawElements should raise INVALID_OPERATION if offset is not a multiple of the type size
+ https://bugs.webkit.org/show_bug.cgi?id=51726
+
+ * fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt:
+ * fast/canvas/webgl/draw-elements-out-of-bounds.html: Add test cases to verify the behavior.
+
2010-12-29 Mihai Parparita <mihaip@chromium.org>
Unreviewed Chromium expectations update.
PASS context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR.
+PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR.
+PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 1) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 2) generated expected GL error: NO_ERROR.
PASS successfullyParsed is true
shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_SHORT, 0)");
+// invalid operation with offset that's not a multiple of the type size
+shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 1)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 2)");
+
debug("")
successfullyParsed = true;
</script>