+2012-01-24 Gregg Tavares <gman@google.com>
+
+ 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 <bashi@chromium.org>
[V8] Add Uint8ClampedArray support
--- /dev/null
+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
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL CompressedTexImage and CompressedTexSubImage Tests</title>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("This test ensures WebGL implementations correctly implement compressedTexImage2D and compressedTexSubImage2D.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.createElement("canvas");
+var gl = wtu.create3DContext(canvas);
+
+const COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+const COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+const COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+const ETC1_RGB8_OES = 0x8D64;
+const COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
+const COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
+
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGB_S3TC_DXT1_EXT, 4, 4, 0, new Uint8Array(8))");
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGBA_S3TC_DXT1_EXT, 4, 4, 0, new Uint8Array(8))");
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGBA_S3TC_DXT5_EXT, 4, 4, 0, new Uint8Array(16))");
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, ETC1_RGB8_OES, 4, 4, 0, new Uint8Array(8))");
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 8, 8, 0, new Uint8Array(8))");
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, 8, 8, 0, new Uint8Array(8))");
+}
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
+
+2012-01-24 Gregg Tavares <gman@google.com>
+
+ 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 <bashi@chromium.org>
[V8] Add Uint8ClampedArray support
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())
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);
[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);