2010-06-11 Zhenyao Mo <zmo@google.com>
Reviewed by Dimitri Glazkov.
drawElements/drawArrays should validate input parameters according to GLES2 spec
https://bugs.webkit.org/show_bug.cgi?id=38700
* fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt: Copied from LayoutTests/fast/canvas/webgl/drawArraysOutOfBounds-expected.txt, and fix a few test cases.
* fast/canvas/webgl/draw-arrays-out-of-bounds.html: Copied from LayoutTests/fast/canvas/webgl/drawArraysOutOfBounds.html, and fix a few test cases.
* fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt: Copied from LayoutTests/fast/canvas/webgl/drawElementssOutOfBounds-expected.txt, and fix a few test cases.
* fast/canvas/webgl/draw-elements-out-of-bounds.html: Copied from LayoutTests/fast/canvas/webgl/drawElementssOutOfBounds.html, and fix a few test cases.
* fast/canvas/webgl/drawArraysOutOfBounds-expected.txt: Removed.
* fast/canvas/webgl/drawArraysOutOfBounds.html: Removed.
* fast/canvas/webgl/drawElementssOutOfBounds-expected.txt: Removed.
* fast/canvas/webgl/drawElementssOutOfBounds.html: Removed.
* fast/canvas/webgl/resources/webgl-test.js: Add helper functions for easy test of gl function errors.
(getGLErrorAsString):
(shouldGenerateGLError):
2010-06-11 Zhenyao Mo <zmo@google.com>
Reviewed by Dimitri Glazkov.
drawElements/drawArrays should validate input parameters according to GLES2 spec
https://bugs.webkit.org/show_bug.cgi?id=38700
Tests: fast/canvas/webgl/draw-arrays-out-of-bounds.html
fast/canvas/webgl/draw-elements-out-of-bounds.html
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::drawArrays): Validate input parameters.
(WebCore::WebGLRenderingContext::drawElements): Ditto.
(WebCore::WebGLRenderingContext::validateDrawMode): Validate mode for draw{Arrays/Elements}.
* html/canvas/WebGLRenderingContext.h: Add validateDrawMode, fix incorrect parameter types.
* html/canvas/WebGLRenderingContext.idl: Fix incorrect parameter types.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61017
268f45cc-cd09-0410-ab3c-
d52691b4dbfc