[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

zmo at google.com zmo at google.com
Wed Dec 22 11:50:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e788fe6cc668bc4dddc103644a71a934e4e815f8
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 9 20:36:02 2010 +0000

    2010-08-09  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by David Levin.
    
            sizeInBytes should be removed
            https://bugs.webkit.org/show_bug.cgi?id=43693
    
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::sizeInBytes): Don't generate GL errors.  Generate them in the callers instead.
            (WebCore::WebGLRenderingContext::vertexAttribPointer): Generate GL error if sizeInBytes fails.
            * html/canvas/WebGLRenderingContext.h: Make sizeInBytes private helper.
            * html/canvas/WebGLRenderingContext.idl: Remove sizeInBytes.
    2010-08-09  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by David Levin.
    
            sizeInBytes should be removed
            https://bugs.webkit.org/show_bug.cgi?id=43693
    
            * fast/canvas/webgl/gl-object-get-calls-expected.txt: Define sizeInBytes and don't use the WebGL one (it's been removed).
            * fast/canvas/webgl/gl-object-get-calls.html: Ditto.
            * fast/canvas/webgl/index-validation.html: Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64998 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index db95602..0c64ead 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-09  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by David Levin.
+
+        sizeInBytes should be removed
+        https://bugs.webkit.org/show_bug.cgi?id=43693
+
+        * fast/canvas/webgl/gl-object-get-calls-expected.txt: Define sizeInBytes and don't use the WebGL one (it's been removed).
+        * fast/canvas/webgl/gl-object-get-calls.html: Ditto.
+        * fast/canvas/webgl/index-validation.html: Ditto.
+
 2010-08-09  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt b/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt
index 81bdac4..bfa3d07 100644
--- a/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt
@@ -75,7 +75,7 @@ PASS gl.getUniform(matProgram, mval4Loc) is [14, 15, 16, 17, 18, 19, 20, 21, 22,
 PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) is buffer
 PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is true
 PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_SIZE) is 4
-PASS (gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 0) || (gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 4 * gl.sizeInBytes(gl.FLOAT)) is true
+PASS (gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 0) || (gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 4 * sizeInBytes(gl.FLOAT)) is true
 PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) is gl.FLOAT
 PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED) is false
 PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is false
diff --git a/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html b/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html
index 934c1aa..56c4e03 100644
--- a/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html
+++ b/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html
@@ -11,6 +11,23 @@
 <script>
 description("Test of get calls against GL objects like getBufferParameter, etc.");
 
+function sizeInBytes(type) {
+  switch (type) {
+  case gl.BYTE:
+  case gl.UNSIGNED_BYTE:
+    return 1;
+  case gl.SHORT:
+  case gl.UNSIGNED_SHORT:
+    return 2;
+  case gl.INT:
+  case gl.UNSIGNED_INT:
+  case gl.FLOAT:
+    return 4;
+  default:
+    throw "unknown type";
+  }
+}
+
 var gl = create3DContext();
 
 var standardVert = loadStandardVertexShader(gl);
@@ -197,7 +214,7 @@ gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0);
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)', 'buffer');
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED)', 'true');
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_SIZE)', '4');
-shouldBe('(gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 0) || (gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 4 * gl.sizeInBytes(gl.FLOAT))', 'true');
+shouldBe('(gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 0) || (gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == 4 * sizeInBytes(gl.FLOAT))', 'true');
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE)', 'gl.FLOAT');
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED)', 'false');
 gl.disableVertexAttribArray(1);
diff --git a/LayoutTests/fast/canvas/webgl/index-validation.html b/LayoutTests/fast/canvas/webgl/index-validation.html
index 9486a1a..f3139e8 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation.html
+++ b/LayoutTests/fast/canvas/webgl/index-validation.html
@@ -11,6 +11,23 @@
 <script>
 description("Tests that index validation verifies the correct number of indices");
 
+function sizeInBytes(type) {
+  switch (type) {
+  case gl.BYTE:
+  case gl.UNSIGNED_BYTE:
+    return 1;
+  case gl.SHORT:
+  case gl.UNSIGNED_SHORT:
+    return 2;
+  case gl.INT:
+  case gl.UNSIGNED_INT:
+  case gl.FLOAT:
+    return 4;
+  default:
+    throw "unknown type";
+  }
+}
+
 var gl = create3DContext();
 var program = loadStandardProgram(gl);
 
@@ -39,9 +56,9 @@ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
 gl.useProgram(program);
 var vertexLoc = gl.getAttribLocation(program, "a_vertex");
 var normalLoc = gl.getAttribLocation(program, "a_normal");
-gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * gl.sizeInBytes(gl.FLOAT), 0);
+gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
 gl.enableVertexAttribArray(vertexLoc);
-gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * gl.sizeInBytes(gl.FLOAT), 4 * gl.sizeInBytes(gl.FLOAT));
+gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
 gl.enableVertexAttribArray(normalLoc);
 shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
 shouldBe('gl.getError()', '0');
@@ -53,7 +70,7 @@ debug("Testing with out-of-range indices");
 var bufferIncomplete = gl.createBuffer();
 gl.bindBuffer(gl.ARRAY_BUFFER, bufferIncomplete);
 gl.bufferData(gl.ARRAY_BUFFER, dataIncomplete, gl.STATIC_DRAW);
-gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * gl.sizeInBytes(gl.FLOAT), 0);
+gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
 gl.enableVertexAttribArray(vertexLoc);
 gl.disableVertexAttribArray(normalLoc);
 debug("Enable vertices, valid");
@@ -61,7 +78,7 @@ shouldBe('gl.getError()', '0');
 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
 shouldBe('gl.getError()', '0');
 debug("Enable normals, out-of-range");
-gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * gl.sizeInBytes(gl.FLOAT), 4 * gl.sizeInBytes(gl.FLOAT));
+gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
 gl.enableVertexAttribArray(normalLoc);
 shouldBe('gl.getError()', '0');
 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
@@ -77,7 +94,7 @@ shouldBe('gl.getError()', '0');
 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
 shouldBe('gl.getError()', 'gl.INVALID_OPERATION');
 debug("Enable an extra attribute with insufficient data buffer");
-gl.vertexAttribPointer(extraLoc, 3, gl.FLOAT, false, 7 * gl.sizeInBytes(gl.FLOAT), 4 * gl.sizeInBytes(gl.FLOAT));
+gl.vertexAttribPointer(extraLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
 shouldBe('gl.getError()', '0');
 shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
 shouldBe('gl.getError()', '0');
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 48e1b72..0374007 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-09  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by David Levin.
+
+        sizeInBytes should be removed
+        https://bugs.webkit.org/show_bug.cgi?id=43693
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::sizeInBytes): Don't generate GL errors.  Generate them in the callers instead.
+        (WebCore::WebGLRenderingContext::vertexAttribPointer): Generate GL error if sizeInBytes fails.
+        * html/canvas/WebGLRenderingContext.h: Make sizeInBytes private helper.
+        * html/canvas/WebGLRenderingContext.idl: Remove sizeInBytes.
+
 2010-08-09  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index ffe17b6..0284ec6 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -195,14 +195,9 @@ void WebGLRenderingContext::reshape(int width, int height)
     m_context->reshape(width, height);
 }
 
-int WebGLRenderingContext::sizeInBytes(int type, ExceptionCode& ec)
+int WebGLRenderingContext::sizeInBytes(int type)
 {
-    UNUSED_PARAM(ec);
-    int result = m_context->sizeInBytes(type);
-    if (result <= 0)
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
-
-    return result;
+    return m_context->sizeInBytes(type);
 }
 
 void WebGLRenderingContext::activeTexture(unsigned long texture, ExceptionCode& ec)
@@ -3021,6 +3016,7 @@ void WebGLRenderingContext::vertexAttrib4fv(unsigned long index, float* v, int s
 
 void WebGLRenderingContext::vertexAttribPointer(unsigned long index, long size, unsigned long type, bool normalized, long stride, long offset, ExceptionCode& ec)
 {
+    UNUSED_PARAM(ec);
     if (index >= m_maxVertexAttribs) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
         return;
@@ -3034,9 +3030,11 @@ void WebGLRenderingContext::vertexAttribPointer(unsigned long index, long size,
         return;
     }
     // Determine the number of elements the bound buffer can hold, given the offset, size, type and stride
-    long bytesPerElement = size * sizeInBytes(type, ec);
-    if (bytesPerElement <= 0)
+    long bytesPerElement = size * sizeInBytes(type);
+    if (bytesPerElement <= 0) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
         return;
+    }
 
     if (index >= m_vertexAttribState.size())
         m_vertexAttribState.resize(index + 1);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index 5371305..608797f 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -60,10 +60,6 @@ public:
     virtual bool is3d() const { return true; }
     virtual bool isAccelerated() const { return true; }
 
-    // Helper to return the size in bytes of OpenGL data types
-    // like GL_FLOAT, GL_INT, etc.
-    int sizeInBytes(int type, ExceptionCode& ec);
-
     void activeTexture(unsigned long texture, ExceptionCode& ec);
     void attachShader(WebGLProgram*, WebGLShader*, ExceptionCode& ec);
     void bindAttribLocation(WebGLProgram*, unsigned long index, const String& name, ExceptionCode& ec);
@@ -336,6 +332,10 @@ public:
 
     bool isGLES2Compliant();
 
+    // Helper to return the size in bytes of OpenGL data types
+    // like GL_FLOAT, GL_INT, etc.
+    int sizeInBytes(int type);
+
     // Basic validation of count and offset against number of elements in element array buffer
     bool validateElementArraySize(unsigned long count, unsigned long type, long offset);
 
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index c53953b..711aa42 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -464,8 +464,6 @@ module html {
         const unsigned int UNPACK_FLIP_Y_WEBGL            = 0x9240;
         const unsigned int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
 
-        long sizeInBytes(in unsigned long type) raises(DOMException);
-
         void         activeTexture(in unsigned long texture) raises(DOMException);
         void         attachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException);
         void         bindAttribLocation(in WebGLProgram program, in unsigned long index, in DOMString name) raises(DOMException);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list