Changeset 116221 in webkit
- Timestamp:
- May 5, 2012, 7:51:39 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116219 r116221 1 2012-05-05 Zhenyao Mo <zmo@google.com> 2 3 vertexAttribPointer needs to reject large negative offsets 4 https://bugs.webkit.org/show_bug.cgi?id=85117 5 6 Reviewed by Kenneth Russell. 7 8 * fast/canvas/webgl/index-validation-expected.txt: 9 * fast/canvas/webgl/index-validation.html: Add a test case for large negative offset. 10 1 11 2012-05-05 'Pavel Feldman' <pfeldman@chromium.org> 2 12 -
trunk/LayoutTests/fast/canvas/webgl/index-validation-expected.txt
r63444 r116221 5 5 Testing with valid indices 6 6 PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE 7 PASS g l.getError() is 07 PASS getError was expected value: NO_ERROR : 8 8 PASS gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0) is undefined. 9 PASS g l.getError() is 09 PASS getError was expected value: NO_ERROR : 10 10 Testing with out-of-range indices 11 11 Enable vertices, valid 12 PASS g l.getError() is 012 PASS getError was expected value: NO_ERROR : 13 13 PASS gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0) is undefined. 14 PASS g l.getError() is 014 PASS getError was expected value: NO_ERROR : 15 15 Enable normals, out-of-range 16 PASS g l.getError() is 016 PASS getError was expected value: NO_ERROR : 17 17 PASS gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0) is undefined. 18 PASS g l.getError() is gl.INVALID_OPERATION18 PASS getError was expected value: INVALID_OPERATION : 19 19 Test with enabled attribute that does not belong to current program 20 20 Enable an extra attribute with null 21 PASS g l.getError() is 021 PASS getError was expected value: NO_ERROR : 22 22 PASS gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0) is undefined. 23 PASS g l.getError() is gl.INVALID_OPERATION23 PASS getError was expected value: INVALID_OPERATION : 24 24 Enable an extra attribute with insufficient data buffer 25 PASS g l.getError() is 025 PASS getError was expected value: NO_ERROR : 26 26 PASS gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0) is undefined. 27 PASS gl.getError() is 0 27 Pass large negative index to vertexAttribPointer 28 PASS getError was expected value: INVALID_VALUE : 29 PASS gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0) is undefined. 28 30 PASS successfullyParsed is true 29 31 -
trunk/LayoutTests/fast/canvas/webgl/index-validation.html
r98407 r116221 1 <!DOCTYPE html> 1 2 <html> 2 3 <head> 4 <meta charset="utf-8"> 5 <link rel="stylesheet" href="../../js/resources/js-test-style.css"/> 3 6 <script src="../../js/resources/js-test-pre.js"></script> 4 7 <script src="resources/webgl-test.js"></script> … … 61 64 gl.enableVertexAttribArray(normalLoc); 62 65 shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE'); 63 shouldBe('gl.getError()', '0');66 glErrorShouldBe(gl, gl.NO_ERROR); 64 67 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)'); 65 shouldBe('gl.getError()', '0');68 glErrorShouldBe(gl, gl.NO_ERROR); 66 69 67 70 debug("Testing with out-of-range indices"); … … 74 77 gl.disableVertexAttribArray(normalLoc); 75 78 debug("Enable vertices, valid"); 76 shouldBe('gl.getError()', '0');79 glErrorShouldBe(gl, gl.NO_ERROR); 77 80 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)'); 78 shouldBe('gl.getError()', '0');81 glErrorShouldBe(gl, gl.NO_ERROR); 79 82 debug("Enable normals, out-of-range"); 80 83 gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT)); 81 84 gl.enableVertexAttribArray(normalLoc); 82 shouldBe('gl.getError()', '0');85 glErrorShouldBe(gl, gl.NO_ERROR); 83 86 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)'); 84 shouldBe('gl.getError()', 'gl.INVALID_OPERATION');87 glErrorShouldBe(gl, gl.INVALID_OPERATION); 85 88 86 89 debug("Test with enabled attribute that does not belong to current program"); … … 90 93 gl.enableVertexAttribArray(extraLoc); 91 94 debug("Enable an extra attribute with null"); 92 shouldBe('gl.getError()', '0');95 glErrorShouldBe(gl, gl.NO_ERROR); 93 96 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)'); 94 shouldBe('gl.getError()', 'gl.INVALID_OPERATION');97 glErrorShouldBe(gl, gl.INVALID_OPERATION); 95 98 debug("Enable an extra attribute with insufficient data buffer"); 96 99 gl.vertexAttribPointer(extraLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT)); 97 shouldBe('gl.getError()', '0');100 glErrorShouldBe(gl, gl.NO_ERROR); 98 101 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)'); 99 shouldBe('gl.getError()', '0'); 102 debug("Pass large negative index to vertexAttribPointer"); 103 gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), -2000000000 * sizeInBytes(gl.FLOAT)); 104 glErrorShouldBe(gl, gl.INVALID_VALUE); 105 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)'); 106 107 successfullyParsed = true; 100 108 </script> 101 109 -
trunk/Source/WebCore/ChangeLog
r116220 r116221 1 2012-05-05 Zhenyao Mo <zmo@google.com> 2 3 vertexAttribPointer needs to reject large negative offsets 4 https://bugs.webkit.org/show_bug.cgi?id=85117 5 6 Reviewed by Kenneth Russell. 7 8 * html/canvas/WebGLRenderingContext.cpp: Use long long for GLsizeiptr and GLintptr 9 (WebCore): 10 (WebCore::WebGLRenderingContext::bufferData): 11 (WebCore::WebGLRenderingContext::bufferSubData): 12 (WebCore::WebGLRenderingContext::drawElements): 13 (WebCore::WebGLRenderingContext::getVertexAttribOffset): 14 (WebCore::WebGLRenderingContext::vertexAttribPointer): 15 * html/canvas/WebGLRenderingContext.h: Ditto 16 (WebGLRenderingContext): 17 * html/canvas/WebGLRenderingContext.idl: Ditto 18 1 19 2012-05-05 Andrey Kosyakov <caseq@chromium.org> 2 20 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r115870 r116221 1037 1037 } 1038 1038 1039 void WebGLRenderingContext::bufferData(GC3Denum target, GC3Dsizeiptrsize, GC3Denum usage, ExceptionCode& ec)1039 void WebGLRenderingContext::bufferData(GC3Denum target, long long size, GC3Denum usage, ExceptionCode& ec) 1040 1040 { 1041 1041 UNUSED_PARAM(ec); … … 1106 1106 } 1107 1107 1108 void WebGLRenderingContext::bufferSubData(GC3Denum target, GC3Dintptroffset, ArrayBuffer* data, ExceptionCode& ec)1108 void WebGLRenderingContext::bufferSubData(GC3Denum target, long long offset, ArrayBuffer* data, ExceptionCode& ec) 1109 1109 { 1110 1110 UNUSED_PARAM(ec); … … 1131 1131 } 1132 1132 1133 void WebGLRenderingContext::bufferSubData(GC3Denum target, GC3Dintptroffset, ArrayBufferView* data, ExceptionCode& ec)1133 void WebGLRenderingContext::bufferSubData(GC3Denum target, long long offset, ArrayBufferView* data, ExceptionCode& ec) 1134 1134 { 1135 1135 UNUSED_PARAM(ec); … … 1899 1899 } 1900 1900 1901 void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptroffset, ExceptionCode& ec)1901 void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, ExceptionCode& ec) 1902 1902 { 1903 1903 UNUSED_PARAM(ec); … … 3039 3039 } 3040 3040 3041 GC3DsizeiptrWebGLRenderingContext::getVertexAttribOffset(GC3Duint index, GC3Denum pname)3041 long long WebGLRenderingContext::getVertexAttribOffset(GC3Duint index, GC3Denum pname) 3042 3042 { 3043 3043 if (isContextLost()) … … 4251 4251 } 4252 4252 4253 void WebGLRenderingContext::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptroffset, ExceptionCode& ec)4253 void WebGLRenderingContext::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, long long offset, ExceptionCode& ec) 4254 4254 { 4255 4255 UNUSED_PARAM(ec); -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h
r115870 r116221 97 97 void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha); 98 98 99 void bufferData(GC3Denum target, GC3Dsizeiptrsize, GC3Denum usage, ExceptionCode&);99 void bufferData(GC3Denum target, long long size, GC3Denum usage, ExceptionCode&); 100 100 void bufferData(GC3Denum target, ArrayBuffer* data, GC3Denum usage, ExceptionCode&); 101 101 void bufferData(GC3Denum target, ArrayBufferView* data, GC3Denum usage, ExceptionCode&); 102 void bufferSubData(GC3Denum target, GC3Dintptroffset, ArrayBuffer* data, ExceptionCode&);103 void bufferSubData(GC3Denum target, GC3Dintptroffset, ArrayBufferView* data, ExceptionCode&);102 void bufferSubData(GC3Denum target, long long offset, ArrayBuffer* data, ExceptionCode&); 103 void bufferSubData(GC3Denum target, long long offset, ArrayBufferView* data, ExceptionCode&); 104 104 105 105 GC3Denum checkFramebufferStatus(GC3Denum target); … … 142 142 void disableVertexAttribArray(GC3Duint index, ExceptionCode&); 143 143 void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count, ExceptionCode&); 144 void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptroffset, ExceptionCode&);144 void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, ExceptionCode&); 145 145 146 146 void enable(GC3Denum cap); … … 175 175 PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&, ExceptionCode&); 176 176 WebGLGetInfo getVertexAttrib(GC3Duint index, GC3Denum pname, ExceptionCode&); 177 GC3DsizeiptrgetVertexAttribOffset(GC3Duint index, GC3Denum pname);177 long long getVertexAttribOffset(GC3Duint index, GC3Denum pname); 178 178 179 179 void hint(GC3Denum target, GC3Denum mode); … … 282 282 void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values, GC3Dsizei size); 283 283 void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, 284 GC3Dsizei stride, GC3Dintptroffset, ExceptionCode&);284 GC3Dsizei stride, long long offset, ExceptionCode&); 285 285 286 286 void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height); -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.idl
r115531 r116221 464 464 [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBuffer data, in unsigned long usage) raises (DOMException); 465 465 [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBufferView data, in unsigned long usage) raises (DOMException); 466 [StrictTypeChecking] void bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException);467 [StrictTypeChecking] void bufferSubData(in unsigned long target, in long offset, in ArrayBuffer data) raises (DOMException);468 [StrictTypeChecking] void bufferSubData(in unsigned long target, in long offset, in ArrayBufferView data) raises (DOMException);466 [StrictTypeChecking] void bufferData(in unsigned long target, in long long size, in unsigned long usage) raises (DOMException); 467 [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBuffer data) raises (DOMException); 468 [StrictTypeChecking] void bufferSubData(in unsigned long target, in long long offset, in ArrayBufferView data) raises (DOMException); 469 469 470 470 [StrictTypeChecking] unsigned long checkFramebufferStatus(in unsigned long target); … … 508 508 [StrictTypeChecking] void disableVertexAttribArray(in unsigned long index) raises(DOMException); 509 509 [StrictTypeChecking] void drawArrays(in unsigned long mode, in long first, in long count) raises(DOMException); 510 [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long offset) raises(DOMException);510 [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long long offset) raises(DOMException); 511 511 512 512 [StrictTypeChecking] void enable(in unsigned long cap); … … 568 568 [StrictTypeChecking, Custom] void getVertexAttrib(); 569 569 570 [StrictTypeChecking] long getVertexAttribOffset(in unsigned long index, in unsigned long pname);570 [StrictTypeChecking] long long getVertexAttribOffset(in unsigned long index, in unsigned long pname); 571 571 572 572 [StrictTypeChecking] void hint(in unsigned long target, in unsigned long mode); … … 662 662 [StrictTypeChecking, Custom] void vertexAttrib4fv(in unsigned long indx, in Float32Array values); 663 663 [StrictTypeChecking] void vertexAttribPointer(in unsigned long indx, in long size, in unsigned long type, in boolean normalized, 664 in long stride, in long offset) raises(DOMException);664 in long stride, in long long offset) raises(DOMException); 665 665 666 666 [StrictTypeChecking] void viewport(in long x, in long y, in long width, in long height);
Note:
See TracChangeset
for help on using the changeset viewer.