From: commit-queue@webkit.org Date: Tue, 24 Jan 2012 09:19:50 +0000 (+0000) Subject: Expose WebGL texture compression methods on WebGLRenderingContext X-Git-Tag: 070512121124~14718 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47eba43687e4bbe4e771ad6f76d629909e4c92bb;p=profile%2Fivi%2Fwebkit-efl.git Expose WebGL texture compression methods on WebGLRenderingContext https://bugs.webkit.org/show_bug.cgi?id=76763 Patch by Gregg Tavares on 2012-01-24 Reviewed by Kenneth Russell. Source/WebCore: Test: fast/canvas/webgl/compressed-tex-image.html * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::compressedTexImage2D): (WebCore::WebGLRenderingContext::compressedTexSubImage2D): * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContext.idl: LayoutTests: * fast/canvas/webgl/compressed-tex-image-expected.txt: Added. * fast/canvas/webgl/compressed-tex-image.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105706 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index ed42609..5843170 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2012-01-24 Gregg Tavares + + Expose WebGL texture compression methods on WebGLRenderingContext + https://bugs.webkit.org/show_bug.cgi?id=76763 + + Reviewed by Kenneth Russell. + + * fast/canvas/webgl/compressed-tex-image-expected.txt: Added. + * fast/canvas/webgl/compressed-tex-image.html: Added. + 2012-01-24 Kenichi Ishibashi [V8] Add Uint8ClampedArray support diff --git a/LayoutTests/fast/canvas/webgl/compressed-tex-image-expected.txt b/LayoutTests/fast/canvas/webgl/compressed-tex-image-expected.txt new file mode 100644 index 0000000..f8ae149 --- /dev/null +++ b/LayoutTests/fast/canvas/webgl/compressed-tex-image-expected.txt @@ -0,0 +1,16 @@ +This test ensures WebGL implementations correctly implement compressedTexImage2D and compressedTexSubImage2D. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS context exists +PASS gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGB_S3TC_DXT1_EXT, 4, 4, 0, new Uint8Array(8)) generated expected GL error: INVALID_ENUM. +PASS gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGBA_S3TC_DXT1_EXT, 4, 4, 0, new Uint8Array(8)) generated expected GL error: INVALID_ENUM. +PASS gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGBA_S3TC_DXT5_EXT, 4, 4, 0, new Uint8Array(16)) generated expected GL error: INVALID_ENUM. +PASS gl.compressedTexImage2D(gl.TEXTURE_2D, 0, ETC1_RGB8_OES, 4, 4, 0, new Uint8Array(8)) generated expected GL error: INVALID_ENUM. +PASS gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 8, 8, 0, new Uint8Array(8)) generated expected GL error: INVALID_ENUM. +PASS gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, 8, 8, 0, new Uint8Array(8)) generated expected GL error: INVALID_ENUM. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/canvas/webgl/compressed-tex-image.html b/LayoutTests/fast/canvas/webgl/compressed-tex-image.html new file mode 100644 index 0000000..5eea42b --- /dev/null +++ b/LayoutTests/fast/canvas/webgl/compressed-tex-image.html @@ -0,0 +1,48 @@ + + + + +WebGL CompressedTexImage and CompressedTexSubImage Tests + + + + + +
+
+ + + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index b0a91e8..1fa6bac 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-01-24 Gregg Tavares + + Expose WebGL texture compression methods on WebGLRenderingContext + https://bugs.webkit.org/show_bug.cgi?id=76763 + + Reviewed by Kenneth Russell. + + Test: fast/canvas/webgl/compressed-tex-image.html + + * html/canvas/WebGLRenderingContext.cpp: + (WebCore::WebGLRenderingContext::compressedTexImage2D): + (WebCore::WebGLRenderingContext::compressedTexSubImage2D): + * html/canvas/WebGLRenderingContext.h: + * html/canvas/WebGLRenderingContext.idl: + 2012-01-24 Kenichi Ishibashi [V8] Add Uint8ClampedArray support diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp index fc6fdbd..1ac7a36 100644 --- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp +++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp @@ -1195,6 +1195,26 @@ void WebGLRenderingContext::compileShader(WebGLShader* shader, ExceptionCode& ec cleanupAfterGraphicsCall(false); } +void WebGLRenderingContext::compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, + GC3Dsizei height, GC3Dint border, ArrayBufferView* data) +{ + if (isContextLost()) + return; + + // FIXME: implement this. + m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); +} + +void WebGLRenderingContext::compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, + GC3Dsizei width, GC3Dsizei height, GC3Denum format, ArrayBufferView* data) +{ + if (isContextLost()) + return; + + // FIXME: implement this. + m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM); +} + void WebGLRenderingContext::copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border) { if (isContextLost()) diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.h b/Source/WebCore/html/canvas/WebGLRenderingContext.h index 5f63cf1..5550360 100644 --- a/Source/WebCore/html/canvas/WebGLRenderingContext.h +++ b/Source/WebCore/html/canvas/WebGLRenderingContext.h @@ -109,8 +109,10 @@ public: void colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha); void compileShader(WebGLShader*, ExceptionCode&); - // void compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data); - // void compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data); + void compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, + GC3Dsizei height, GC3Dint border, ArrayBufferView* data); + void compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, + GC3Dsizei width, GC3Dsizei height, GC3Denum format, ArrayBufferView* data); void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border); void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height); diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.idl b/Source/WebCore/html/canvas/WebGLRenderingContext.idl index 5103af0..0c1700a 100644 --- a/Source/WebCore/html/canvas/WebGLRenderingContext.idl +++ b/Source/WebCore/html/canvas/WebGLRenderingContext.idl @@ -478,9 +478,11 @@ module html { [StrictTypeChecking] void clearStencil(in long s); [StrictTypeChecking] void colorMask(in boolean red, in boolean green, in boolean blue, in boolean alpha); [StrictTypeChecking] void compileShader(in WebGLShader shader) raises(DOMException); - - //void compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in unsigned long width, in unsigned long height, in long border, in unsigned long imageSize, const void* data); - //void compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in unsigned long width, in unsigned long height, in unsigned long format, in unsigned long imageSize, const void* data); + + [StrictTypeChecking] void compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, + in long width, in long height, in long border, in ArrayBufferView data); + [StrictTypeChecking] void compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, + in long width, in long height, in unsigned long format, in ArrayBufferView data); [StrictTypeChecking] void copyTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long x, in long y, in long width, in long height, in long border); [StrictTypeChecking] void copyTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in long x, in long y, in long width, in long height);