[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:23:41 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit f75d7bab2845cad3a2203c69ce303003a7b0a3ab
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 21 21:01:38 2010 +0000

    2010-01-21  Kenneth Russell  <kbr at google.com>
    
            Reviewed by Oliver Hunt.
    
            [Chromium] Implement texSubImage2D taking WebGLArray
            https://bugs.webkit.org/show_bug.cgi?id=33932
    
            * fast/canvas/webgl/tex-sub-image-2d-expected.txt: Added.
            * fast/canvas/webgl/tex-sub-image-2d.html: Added.
    2010-01-21  Kenneth Russell  <kbr at google.com>
    
            Reviewed by Oliver Hunt.
    
            [Chromium] Implement texSubImage2D taking WebGLArray
            https://bugs.webkit.org/show_bug.cgi?id=33932
    
            * src/GraphicsContext3D.cpp:
            (WebCore::GraphicsContext3D::texSubImage2D):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 034590b..e3b05b3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-21  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by Oliver Hunt.
+
+        [Chromium] Implement texSubImage2D taking WebGLArray
+        https://bugs.webkit.org/show_bug.cgi?id=33932
+
+        * fast/canvas/webgl/tex-sub-image-2d-expected.txt: Added.
+        * fast/canvas/webgl/tex-sub-image-2d.html: Added.
+
 2010-01-20  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Dave Hyatt.
diff --git a/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt
new file mode 100644
index 0000000..174d95e
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt
@@ -0,0 +1,7 @@
+Tests texSubImage2D upload path from WebGLUnsignedByteArray
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Regression test for https://bugs.webkit.org/show_bug.cgi?id=33932 : [Chromium] Implement texSubImage2D taking WebGLArray
+PASS 
+
diff --git a/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html
new file mode 100644
index 0000000..e89c796
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html
@@ -0,0 +1,125 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/utils3d.js"> </script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 g_Position;
+attribute vec2 g_TexCoord0;
+
+varying vec2 texCoord;
+
+void main()
+{
+    gl_Position = vec4(g_Position.x, g_Position.y, g_Position.z, 1.0);
+    texCoord = g_TexCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+uniform sampler2D tex;
+varying vec2 texCoord;
+
+void main()
+{
+    float intensity = texture2D(tex, texCoord).a;
+    gl_FragColor = vec4(intensity, intensity, intensity, 1.0);
+}
+</script>
+
+</head>
+<body>
+<canvas id="example" width="256px" height="1px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description('Tests texSubImage2D upload path from WebGLUnsignedByteArray');
+
+debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=33932">https://bugs.webkit.org/show_bug.cgi?id=33932</a> : <code>[Chromium] Implement texSubImage2D taking WebGLArray</code>');
+
+var gl = initWebGL("example", "vshader", "fshader", [ "g_Position", "g_TexCoord0" ], [ 0, 0, 0, 1 ], 1);
+var textureWidth = 256;
+var textureHeight = 1;
+
+gl.viewport(0, 0, textureWidth, textureHeight);
+
+textureLoc = gl.getUniformLocation(gl.program, "tex");
+
+var vertices = new WebGLFloatArray([
+     1.0,  1.0, 0.0,
+    -1.0,  1.0, 0.0,
+    -1.0, -1.0, 0.0,
+     1.0,  1.0, 0.0,
+    -1.0, -1.0, 0.0,
+     1.0, -1.0, 0.0]);
+var texCoords = new WebGLFloatArray([
+    1.0, 1.0,
+    0.0, 1.0,
+    0.0, 0.0,
+    1.0, 1.0,
+    0.0, 0.0,
+    1.0, 0.0]);
+var texCoordOffset = vertices.byteLength;
+
+var vbo = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+gl.bufferData(gl.ARRAY_BUFFER,
+              texCoordOffset + texCoords.byteLength,
+              gl.STATIC_DRAW);
+gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);
+gl.bufferSubData(gl.ARRAY_BUFFER, texCoordOffset, texCoords);
+
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+gl.enableVertexAttribArray(1);
+gl.vertexAttribPointer(1, 2, gl.FLOAT, gl.FALSE, 0, texCoordOffset);
+
+var texture = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+// Allocate the texture object
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.ALPHA, textureWidth, textureHeight, 0, gl.ALPHA, gl.UNSIGNED_BYTE, null);
+// Prepare the image data
+var array = new WebGLUnsignedByteArray(textureWidth);
+for (var i = 0; i < textureWidth; i++)
+    array[i] = i;
+// Fill the texture object with data -- this is actually the code path being tested
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, gl.ALPHA, gl.UNSIGNED_BYTE, array);
+
+// Clear and set up
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.useProgram(gl.program);
+gl.uniform1i(textureLoc, 0);
+// Draw the texture to the frame buffer
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+// Read back the frame buffer
+var buf = gl.readPixels(0, 0, textureWidth, textureHeight, gl.RGBA, gl.UNSIGNED_BYTE);
+
+// Verify the frame buffer's contents
+var passed = true;
+for (var i = 0; i < textureWidth; i++) {
+    var val = i;
+    if (buf[4 * i + 0] != val ||
+        buf[4 * i + 1] != val ||
+        buf[4 * i + 2] != val) {
+        testFailed("pixel at (" + i + ", 0) was (" +
+                   buf[4 * i + 0] + ", " +
+                   buf[4 * i + 1] + ", " +
+                   buf[4 * i + 2] + "), should be (" +
+                   val + ", " + val + ", " + val + ")");
+        passed = false;
+        break;
+    }
+}
+
+if (passed)
+    testPassed("");
+</script>
+</body>
+</html>
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index b74efd8..da2073f 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-21  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by Oliver Hunt.
+
+        [Chromium] Implement texSubImage2D taking WebGLArray
+        https://bugs.webkit.org/show_bug.cgi?id=33932
+
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::texSubImage2D):
+
 2010-01-20  Vitaly Repeshko  <vitalyr at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index c6c1892..7fe31b0 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -2084,9 +2084,8 @@ int GraphicsContext3D::texSubImage2D(unsigned target,
                                      unsigned type,
                                      void* pixels)
 {
-    // FIXME: implement.
-    notImplemented();
-    return -1;
+    glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    return 0;
 }
 
 int GraphicsContext3D::texSubImage2D(unsigned target,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list