2010-07-02 Zhenyao Mo <zmo@google.com>
authorzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jul 2010 19:24:08 +0000 (19:24 +0000)
committerzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jul 2010 19:24:08 +0000 (19:24 +0000)
commit33c2d69fd9e82f4659a6d7e386e84bbd88f317b5
tree4f7d055cd1a0750aca6d45e2e9e22bc817820c3d
parent2aa2c71f4c2f0411e851637c042cd507645d89d2
2010-07-02  Zhenyao Mo  <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Fix issues in boundary situations for WebGLRenderingContext::drawArrays/drawElements
        https://bugs.webkit.org/show_bug.cgi?id=41473

        * fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt: Test against overflow, size-0 buffer, and count==0 situations.
        * fast/canvas/webgl/draw-arrays-out-of-bounds.html: Ditto.
        * fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt: Ditto.
        * fast/canvas/webgl/draw-elements-out-of-bounds.html: Ditto.
2010-07-02  Zhenyao Mo  <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Fix issues in boundary situations for WebGLRenderingContext::drawArrays/drawElements
        https://bugs.webkit.org/show_bug.cgi?id=41473

        * WebCore.gypi: Add CheckedInt.h.
        * WebCore.xcodeproj/project.pbxproj: Add CheckedInt.h.
        * html/canvas/CheckedInt.h: Added support of safe integer operations.
        (mozilla::CheckedInt_internal::integer_type_manually_recorded_info::):
        (mozilla::CheckedInt_internal::is_unsupported_type::):
        (mozilla::CheckedInt_internal::):
        (mozilla::CheckedInt_internal::integer_traits::):
        (mozilla::CheckedInt_internal::integer_traits::min):
        (mozilla::CheckedInt_internal::integer_traits::max):
        (mozilla::CheckedInt_internal::has_sign_bit):
        (mozilla::CheckedInt_internal::binary_complement):
        (mozilla::CheckedInt_internal::is_in_range):
        (mozilla::CheckedInt_internal::is_add_valid):
        (mozilla::CheckedInt_internal::is_sub_valid):
        (mozilla::CheckedInt_internal::is_mul_valid):
        (mozilla::CheckedInt_internal::is_div_valid):
        (mozilla::CheckedInt::CheckedInt):
        (mozilla::CheckedInt::value):
        (mozilla::CheckedInt::valid):
        (mozilla::CheckedInt::operator -):
        (mozilla::CheckedInt::operator ==):
        (mozilla::CheckedInt::operator !=):
        (mozilla::operator /):
        (mozilla::cast_to_CheckedInt_impl::run):
        (mozilla::):
        (mozilla::cast_to_CheckedInt):
        (mozilla::operator ==):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Fix a bug against 0-size buffer situation.
        (WebCore::WebGLRenderingContext::drawArrays): Deal with overflows and count==0 situation.
        (WebCore::WebGLRenderingContext::drawElements): Deal with count==0 situation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@62397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt
LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html
LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt
LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html
WebCore/ChangeLog
WebCore/WebCore.gypi
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/html/canvas/CheckedInt.h [new file with mode: 0644]
WebCore/html/canvas/WebGLRenderingContext.cpp