2010-06-11 Zhenyao Mo <zmo@google.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jun 2010 14:38:42 +0000 (14:38 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jun 2010 14:38:42 +0000 (14:38 +0000)
commit214cd5214cc7f819dd11686faa525c7af620c0ab
tree2a473bd230ba7a6f6d843eaf234a1262f06a0741
parenta4343b769ab08e8c82b02a3ad1d20762e012d194
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
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/drawArraysOutOfBounds-expected.txt [deleted file]
LayoutTests/fast/canvas/webgl/drawArraysOutOfBounds.html [deleted file]
LayoutTests/fast/canvas/webgl/drawElementssOutOfBounds-expected.txt [deleted file]
LayoutTests/fast/canvas/webgl/drawElementssOutOfBounds.html [deleted file]
LayoutTests/fast/canvas/webgl/resources/webgl-test.js
WebCore/ChangeLog
WebCore/html/canvas/WebGLRenderingContext.cpp
WebCore/html/canvas/WebGLRenderingContext.h
WebCore/html/canvas/WebGLRenderingContext.idl