[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

zmo at google.com zmo at google.com
Fri Jan 21 14:44:37 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit fbdedd400054908e94138160d3a7f502e0c3d0b6
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 28 21:26:58 2010 +0000

    2010-12-23  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Map GLsizei to long instead of unsigned long in WebGLRenderingContext and GraphicsContext3D
            https://bugs.webkit.org/show_bug.cgi?id=39855
    
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::copyTexImage2D): Map GLsizei to long.
            (WebCore::WebGLRenderingContext::copyTexSubImage2D): Ditto.
            (WebCore::WebGLRenderingContext::renderbufferStorage): Ditto.
            (WebCore::WebGLRenderingContext::scissor): Ditto.
            (WebCore::WebGLRenderingContext::texImage2DBase): Ditto.
            (WebCore::WebGLRenderingContext::texImage2D): Ditto.
            (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
            (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
            (WebCore::WebGLRenderingContext::texSubImage2D): Ditto.
            (WebCore::WebGLRenderingContext::viewport): Ditto.
            (WebCore::WebGLRenderingContext::validateSize): Check the sizes are non-negative.
            * html/canvas/WebGLRenderingContext.h:
            * html/canvas/WebGLRenderingContext.idl:
    2010-12-28  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Map GLsizei to long instead of unsigned long in WebGLRenderingContext and GraphicsContext3D
            https://bugs.webkit.org/show_bug.cgi?id=39855
    
            * fast/canvas/webgl/invalid-passed-params-expected.txt: Add test cases for negative offset/width/height.
            * fast/canvas/webgl/invalid-passed-params.html: Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74719 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c349fc8..17ad24c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-28  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Map GLsizei to long instead of unsigned long in WebGLRenderingContext and GraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=39855
+
+        * fast/canvas/webgl/invalid-passed-params-expected.txt: Add test cases for negative offset/width/height.
+        * fast/canvas/webgl/invalid-passed-params.html: Ditto.
+
 2010-12-28  Kenneth Russell  <kbr at google.com>
 
         Unreviewed, Chromium test expectations update. Mark
diff --git a/LayoutTests/fast/canvas/webgl/invalid-passed-params-expected.txt b/LayoutTests/fast/canvas/webgl/invalid-passed-params-expected.txt
index 882d9e6..c7524cc 100644
--- a/LayoutTests/fast/canvas/webgl/invalid-passed-params-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/invalid-passed-params-expected.txt
@@ -23,6 +23,28 @@ PASS context.bufferData(context.ARRAY_BUFFER, 16, desktopGL['STATIC_READ']) gene
 PASS context.bufferData(context.ARRAY_BUFFER, 16, desktopGL['STATIC_COPY']) generated expected GL error: INVALID_ENUM.
 PASS context.bufferData(context.ARRAY_BUFFER, 16, desktopGL['DYNAMIC_READ']) generated expected GL error: INVALID_ENUM.
 PASS context.bufferData(context.ARRAY_BUFFER, 16, desktopGL['DYNAMIC_COPY']) generated expected GL error: INVALID_ENUM.
+Test {copy}Tex{Sub}Image2D with negative offset/width/height
+PASS context.bindTexture(context.TEXTURE_2D, tex) generated expected GL error: NO_ERROR.
+PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, -16, -16, 0, context.RGBA, context.UNSIGNED_BYTE, null) generated expected GL error: INVALID_VALUE.
+PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 16, 16, 0, context.RGBA, context.UNSIGNED_BYTE, null) generated expected GL error: NO_ERROR.
+PASS context.texSubImage2D(context.TEXTURE_2D, 0, -1, -1, 2, 2, context.RGBA, context.UNSIGNED_BYTE, pixels) generated expected GL error: INVALID_VALUE.
+PASS context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, -1, -1, context.RGBA, context.UNSIGNED_BYTE, pixels) generated expected GL error: INVALID_VALUE.
+PASS context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, 2, 2, context.RGBA, context.UNSIGNED_BYTE, pixels) generated expected GL error: NO_ERROR.
+PASS context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, -1, -1, 0) generated expected GL error: INVALID_VALUE.
+PASS context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, 16, 16, 0) generated expected GL error: NO_ERROR.
+PASS context.copyTexSubImage2D(context.TEXTURE_2D, 0, -1, -1, 0, 0, 2, 2) generated expected GL error: INVALID_VALUE.
+PASS context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, -1, -1) generated expected GL error: INVALID_VALUE.
+PASS context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, 2, 2) generated expected GL error: NO_ERROR.
+Test renderbufferStorage() with negative width/height
+PASS context.bindRenderbuffer(context.RENDERBUFFER, renderbuffer) generated expected GL error: NO_ERROR.
+PASS context.renderbufferStorage(context.RENDERBUFFER, context.RGBA4, -2, -2) generated expected GL error: INVALID_VALUE.
+PASS context.renderbufferStorage(context.RENDERBUFFER, context.RGBA4, 16, 16) generated expected GL error: NO_ERROR.
+Test scissor() with negative width/height
+PASS context.scissor(0, 0, -2, -2) generated expected GL error: INVALID_VALUE.
+PASS context.scissor(0, 0, 16, 16) generated expected GL error: NO_ERROR.
+Test viewport() with negative width/height
+PASS context.viewport(0, 0, -2, -2) generated expected GL error: INVALID_VALUE.
+PASS context.viewport(0, 0, 16, 16) generated expected GL error: NO_ERROR.
 
 PASS successfullyParsed is true
 
diff --git a/LayoutTests/fast/canvas/webgl/invalid-passed-params.html b/LayoutTests/fast/canvas/webgl/invalid-passed-params.html
index 99991e6..3b49cc5 100644
--- a/LayoutTests/fast/canvas/webgl/invalid-passed-params.html
+++ b/LayoutTests/fast/canvas/webgl/invalid-passed-params.html
@@ -39,6 +39,35 @@ shouldGenerateGLError(context, context.INVALID_ENUM, "context.bufferData(context
 shouldGenerateGLError(context, context.INVALID_ENUM, "context.bufferData(context.ARRAY_BUFFER, 16, desktopGL['DYNAMIC_READ'])");
 shouldGenerateGLError(context, context.INVALID_ENUM, "context.bufferData(context.ARRAY_BUFFER, 16, desktopGL['DYNAMIC_COPY'])");
 
+debug("Test {copy}Tex{Sub}Image2D with negative offset/width/height");
+var tex = context.createTexture();
+var pixels = new Uint8Array(2 * 2 * 4);
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindTexture(context.TEXTURE_2D, tex)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, -16, -16, 0, context.RGBA, context.UNSIGNED_BYTE, null)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 16, 16, 0, context.RGBA, context.UNSIGNED_BYTE, null)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.texSubImage2D(context.TEXTURE_2D, 0, -1, -1, 2, 2, context.RGBA, context.UNSIGNED_BYTE, pixels)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, -1, -1, context.RGBA, context.UNSIGNED_BYTE, pixels)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, 2, 2, context.RGBA, context.UNSIGNED_BYTE, pixels)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, -1, -1, 0)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, 16, 16, 0)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.copyTexSubImage2D(context.TEXTURE_2D, 0, -1, -1, 0, 0, 2, 2)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, -1, -1)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, 2, 2)");
+
+debug("Test renderbufferStorage() with negative width/height");
+var renderbuffer = context.createRenderbuffer();
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindRenderbuffer(context.RENDERBUFFER, renderbuffer)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.renderbufferStorage(context.RENDERBUFFER, context.RGBA4, -2, -2)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.renderbufferStorage(context.RENDERBUFFER, context.RGBA4, 16, 16)");
+
+debug("Test scissor() with negative width/height");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.scissor(0, 0, -2, -2)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.scissor(0, 0, 16, 16)");
+
+debug("Test viewport() with negative width/height");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.viewport(0, 0, -2, -2)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.viewport(0, 0, 16, 16)");
+
 debug("")
 successfullyParsed = true;
 </script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 716a242..0bfc1e7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-12-23  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Map GLsizei to long instead of unsigned long in WebGLRenderingContext and GraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=39855
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::copyTexImage2D): Map GLsizei to long.
+        (WebCore::WebGLRenderingContext::copyTexSubImage2D): Ditto.
+        (WebCore::WebGLRenderingContext::renderbufferStorage): Ditto.
+        (WebCore::WebGLRenderingContext::scissor): Ditto.
+        (WebCore::WebGLRenderingContext::texImage2DBase): Ditto.
+        (WebCore::WebGLRenderingContext::texImage2D): Ditto.
+        (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
+        (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
+        (WebCore::WebGLRenderingContext::texSubImage2D): Ditto.
+        (WebCore::WebGLRenderingContext::viewport): Ditto.
+        (WebCore::WebGLRenderingContext::validateSize): Check the sizes are non-negative.
+        * html/canvas/WebGLRenderingContext.h:
+        * html/canvas/WebGLRenderingContext.idl:
+
 2010-12-28  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index ca26ba3..90ba6ee 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -629,7 +629,7 @@ void WebGLRenderingContext::compileShader(WebGLShader* shader, ExceptionCode& ec
     cleanupAfterGraphicsCall(false);
 }
 
-void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
+void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, long width, long height, long border)
 {
     if (isContextLost())
         return;
@@ -656,13 +656,15 @@ void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, uns
     cleanupAfterGraphicsCall(false);
 }
 
-void WebGLRenderingContext::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
+void WebGLRenderingContext::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, long width, long height)
 {
     if (isContextLost())
         return;
     WebGLTexture* tex = validateTextureBinding(target, true);
     if (!tex)
         return;
+    if (!validateSize(xoffset, yoffset) || !validateSize(width, height))
+        return;
     if (!isTexInternalFormatColorBufferCombinationValid(tex->getInternalFormat(level), getBoundFramebufferColorFormat())) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
@@ -2362,7 +2364,7 @@ void WebGLRenderingContext::releaseShaderCompiler()
     cleanupAfterGraphicsCall(false);
 }
 
-void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
+void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned long internalformat, long width, long height)
 {
     if (isContextLost())
         return;
@@ -2374,6 +2376,8 @@ void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned l
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
+    if (!validateSize(width, height))
+        return;
     switch (internalformat) {
     case GraphicsContext3D::DEPTH_COMPONENT16:
     case GraphicsContext3D::RGBA4:
@@ -2407,10 +2411,12 @@ void WebGLRenderingContext::sampleCoverage(double value, bool invert)
     cleanupAfterGraphicsCall(false);
 }
 
-void WebGLRenderingContext::scissor(long x, long y, unsigned long width, unsigned long height)
+void WebGLRenderingContext::scissor(long x, long y, long width, long height)
 {
     if (isContextLost())
         return;
+    if (!validateSize(width, height))
+        return;
     m_context->scissor(x, y, width, height);
     cleanupAfterGraphicsCall(false);
 }
@@ -2497,7 +2503,7 @@ void WebGLRenderingContext::stencilOpSeparate(unsigned long face, unsigned long
 }
 
 void WebGLRenderingContext::texImage2DBase(unsigned target, unsigned level, unsigned internalformat,
-                                           unsigned width, unsigned height, unsigned border,
+                                           int width, int height, unsigned border,
                                            unsigned format, unsigned type, void* pixels, ExceptionCode& ec)
 {
     // FIXME: For now we ignore any errors returned
@@ -2545,7 +2551,7 @@ void WebGLRenderingContext::texImage2DImpl(unsigned target, unsigned level, unsi
 }
 
 void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned internalformat,
-                                       unsigned width, unsigned height, unsigned border,
+                                       int width, int height, unsigned border,
                                        unsigned format, unsigned type, ArrayBufferView* pixels, ExceptionCode& ec)
 {
     if (isContextLost() || !validateTexFuncData(width, height, format, type, pixels))
@@ -2694,8 +2700,8 @@ void WebGLRenderingContext::texParameteri(unsigned target, unsigned pname, int p
     texParameter(target, pname, 0, param, false);
 }
 
-void WebGLRenderingContext::texSubImage2DBase(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
-                                              unsigned width, unsigned height,
+void WebGLRenderingContext::texSubImage2DBase(unsigned target, unsigned level, int xoffset, int yoffset,
+                                              int width, int height,
                                               unsigned format, unsigned type, void* pixels, ExceptionCode& ec)
 {
     // FIXME: For now we ignore any errors returned
@@ -2706,11 +2712,13 @@ void WebGLRenderingContext::texSubImage2DBase(unsigned target, unsigned level, u
         return;
     if (!validateTextureBinding(target, true))
         return;
+    if (!validateSize(xoffset, yoffset) || !validateSize(width, height))
+        return;
     m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
     cleanupAfterGraphicsCall(false);
 }
 
-void WebGLRenderingContext::texSubImage2DImpl(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+void WebGLRenderingContext::texSubImage2DImpl(unsigned target, unsigned level, int xoffset, int yoffset,
                                               unsigned format, unsigned type,
                                               Image* image, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
 {
@@ -2726,8 +2734,8 @@ void WebGLRenderingContext::texSubImage2DImpl(unsigned target, unsigned level, u
                       format, type, data.data(), ec);
 }
 
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
-                                          unsigned width, unsigned height,
+void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
+                                          int width, int height,
                                           unsigned format, unsigned type, ArrayBufferView* pixels, ExceptionCode& ec)
 {
     if (isContextLost() || !validateTexFuncData(width, height, format, type, pixels))
@@ -2752,7 +2760,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
         m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
 }
 
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                                           unsigned format, unsigned type, ImageData* pixels, ExceptionCode& ec)
 {
     ec = 0;
@@ -2767,7 +2775,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
                       format, type, data.data(), ec);
 }
 
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                                           unsigned format, unsigned type, HTMLImageElement* image, ExceptionCode& ec)
 {
     ec = 0;
@@ -2782,7 +2790,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
                       m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
 }
 
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                                           unsigned format, unsigned type, HTMLCanvasElement* canvas, ExceptionCode& ec)
 {
     ec = 0;
@@ -2797,7 +2805,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
                       m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
 }
 
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                                           unsigned format, unsigned type, HTMLVideoElement* video, ExceptionCode& ec)
 {
     ec = 0;
@@ -3284,7 +3292,7 @@ void WebGLRenderingContext::vertexAttribPointer(unsigned long index, long size,
     cleanupAfterGraphicsCall(false);
 }
 
-void WebGLRenderingContext::viewport(long x, long y, unsigned long width, unsigned long height)
+void WebGLRenderingContext::viewport(long x, long y, long width, long height)
 {
     if (isContextLost())
         return;
@@ -3296,6 +3304,8 @@ void WebGLRenderingContext::viewport(long x, long y, unsigned long width, unsign
         width = 100;
     if (isnan(height))
         height = 100;
+    if (!validateSize(width, height))
+        return;
     m_context->viewport(x, y, width, height);
     cleanupAfterGraphicsCall(false);
 }
@@ -3608,6 +3618,15 @@ WebGLTexture* WebGLRenderingContext::validateTextureBinding(unsigned long target
     return tex;
 }
 
+bool WebGLRenderingContext::validateSize(long x, long y)
+{
+    if (x < 0 || y < 0) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return false;
+    }
+    return true;
+}
+
 bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, unsigned long type)
 {
     switch (format) {
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index b693844..c8c4bdb 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -97,8 +97,8 @@ public:
     // void compressedTexImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long width, unsigned long height, long border, unsigned long imageSize, const void* data);
     // void compressedTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long width, unsigned long height, unsigned long format, unsigned long imageSize, const void* data);
 
-    void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
-    void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
+    void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, long width, long height, long border);
+    void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, long width, long height);
 
     PassRefPtr<WebGLBuffer> createBuffer();
     PassRefPtr<WebGLFramebuffer> createFramebuffer();
@@ -195,9 +195,9 @@ public:
     void polygonOffset(double factor, double units);
     void readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView* pixels, ExceptionCode&);
     void releaseShaderCompiler();
-    void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
+    void renderbufferStorage(unsigned long target, unsigned long internalformat, long width, long height);
     void sampleCoverage(double value, bool invert);
-    void scissor(long x, long y, unsigned long width, unsigned long height);
+    void scissor(long x, long y, long width, long height);
     void shaderSource(WebGLShader*, const String&, ExceptionCode&);
     void stencilFunc(unsigned long func, long ref, unsigned long mask);
     void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
@@ -207,7 +207,7 @@ public:
     void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
 
     void texImage2D(unsigned target, unsigned level, unsigned internalformat,
-                    unsigned width, unsigned height, unsigned border,
+                    int width, int height, unsigned border,
                     unsigned format, unsigned type, ArrayBufferView* pixels, ExceptionCode&);
     void texImage2D(unsigned target, unsigned level, unsigned internalformat,
                     unsigned format, unsigned type, ImageData* pixels, ExceptionCode&);
@@ -221,16 +221,16 @@ public:
     void texParameterf(unsigned target, unsigned pname, float param);
     void texParameteri(unsigned target, unsigned pname, int param);
 
-    void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
-                       unsigned width, unsigned height,
+    void texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
+                       int width, int height,
                        unsigned format, unsigned type, ArrayBufferView* pixels, ExceptionCode&);
-    void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+    void texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                        unsigned format, unsigned type, ImageData* pixels, ExceptionCode&);
-    void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+    void texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                        unsigned format, unsigned type, HTMLImageElement* image, ExceptionCode&);
-    void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+    void texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                        unsigned format, unsigned type, HTMLCanvasElement* canvas, ExceptionCode&);
-    void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+    void texSubImage2D(unsigned target, unsigned level, int xoffset, int yoffset,
                        unsigned format, unsigned type, HTMLVideoElement* video, ExceptionCode&);
 
     void uniform1f(const WebGLUniformLocation* location, float x, ExceptionCode&);
@@ -282,7 +282,7 @@ public:
     void vertexAttribPointer(unsigned long index, long size, unsigned long type, bool normalized,
                              long stride, long offset, ExceptionCode&);
 
-    void viewport(long x, long y, unsigned long width, unsigned long height);
+    void viewport(long x, long y, long width, long height);
 
     void loseContext();
     void restoreContext();
@@ -480,15 +480,15 @@ public:
     WebGLGetInfo getWebGLIntArrayParameter(unsigned long pname);
 
     void texImage2DBase(unsigned target, unsigned level, unsigned internalformat,
-                        unsigned width, unsigned height, unsigned border,
+                        int width, int height, unsigned border,
                         unsigned format, unsigned type, void* pixels, ExceptionCode&);
     void texImage2DImpl(unsigned target, unsigned level, unsigned internalformat,
                         unsigned format, unsigned type, Image* image,
                         bool flipY, bool premultiplyAlpha, ExceptionCode&);
-    void texSubImage2DBase(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
-                           unsigned width, unsigned height,
+    void texSubImage2DBase(unsigned target, unsigned level, int xoffset, int yoffset,
+                           int width, int height,
                            unsigned format, unsigned type, void* pixels, ExceptionCode&);
-    void texSubImage2DImpl(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
+    void texSubImage2DImpl(unsigned target, unsigned level, int xoffset, int yoffset,
                            unsigned format, unsigned type,
                            Image* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
 
@@ -505,6 +505,10 @@ public:
     // Helper function to get the bound framebuffer's color buffer format.
     unsigned long getBoundFramebufferColorFormat();
 
+    // Helper function to check if size is non-negative.
+    // Generate GL error and return false for negative inputs; otherwise, return true.
+    bool validateSize(long x, long y);
+
     // Helper function to check target and texture bound to the target.
     // Generate GL errors and return 0 if target is invalid or texture bound is
     // null.  Otherwise, return the texture bound to the target.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index 0cc2e40..97f9980 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -483,8 +483,8 @@ module html {
         //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         copyTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long x, in long y, in unsigned long width, in unsigned 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 unsigned long width, in unsigned long height);
+        [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);
 
         [StrictTypeChecking] WebGLBuffer createBuffer();
         [StrictTypeChecking] WebGLFramebuffer createFramebuffer();
@@ -590,9 +590,9 @@ module html {
         [StrictTypeChecking] void         readPixels(in long x, in long y, in long width, in long height, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises(DOMException);
         
         [StrictTypeChecking] void         releaseShaderCompiler();
-        [StrictTypeChecking] void         renderbufferStorage(in unsigned long target, in unsigned long internalformat, in unsigned long width, in unsigned long height);
+        [StrictTypeChecking] void         renderbufferStorage(in unsigned long target, in unsigned long internalformat, in long width, in long height);
         [StrictTypeChecking] void         sampleCoverage(in double value, in boolean invert);
-        [StrictTypeChecking] void         scissor(in long x, in long y, in unsigned long width, in unsigned long height);
+        [StrictTypeChecking] void         scissor(in long x, in long y, in long width, in long height);
         [StrictTypeChecking] void         shaderSource(in WebGLShader shader, in DOMString string) raises(DOMException);
         [StrictTypeChecking] void         stencilFunc(in unsigned long func, in long ref, in unsigned long mask);
         [StrictTypeChecking] void         stencilFuncSeparate(in unsigned long face, in unsigned long func, in long ref, in unsigned long mask);
@@ -661,9 +661,9 @@ module html {
         [StrictTypeChecking] void         vertexAttrib4f(in unsigned long indx, in float x, in float y, in float z, in float w);
         [StrictTypeChecking, Custom] void         vertexAttrib4fv(in unsigned long indx, in Float32Array values);
         [StrictTypeChecking] void         vertexAttribPointer(in unsigned long indx, in long size, in unsigned long type, in boolean normalized, 
-                                                              in long stride, in unsigned long offset) raises(DOMException);
+                                                              in long stride, in long offset) raises(DOMException);
 
-        [StrictTypeChecking] void         viewport(in long x, in long y, in unsigned long width, in unsigned long height);
+        [StrictTypeChecking] void         viewport(in long x, in long y, in long width, in long height);
     };
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list