[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 15:09:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3995759587440a531c9dc5f4ad22137240c4765f
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 28 16:51:15 2010 +0000

    2010-10-27  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Work around a Mac driver bug in generateMipmap
            https://bugs.webkit.org/show_bug.cgi?id=48489
    
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::generateMipmap): Make sure minFilter is set to NEAREST_MIPMAP_LINEAR before generateMipmap, and after the call, set it back to the original value.
            * html/canvas/WebGLTexture.h:
            (WebCore::WebGLTexture::getMinFilter): Return the cached minFilter value.
    2010-10-27  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Work around a Mac driver bug in generateMipmap
            https://bugs.webkit.org/show_bug.cgi?id=48489
    
            * fast/canvas/webgl/texture-npot-expected.txt: Add back the failing part due to the generateMipmap Mac driver bug.
            * fast/canvas/webgl/texture-npot.html: Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e530994..f468815 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-27  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Work around a Mac driver bug in generateMipmap
+        https://bugs.webkit.org/show_bug.cgi?id=48489
+
+        * fast/canvas/webgl/texture-npot-expected.txt: Add back the failing part due to the generateMipmap Mac driver bug.
+        * fast/canvas/webgl/texture-npot.html: Ditto.
+
 2010-10-28  Mikhail Naganov  <mnaganov at chromium.org>
 
         [Chromium] Unreviewed fix for test_expectations.
diff --git a/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt b/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt
index 8c66cd4..32dedd2 100644
--- a/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt
@@ -24,6 +24,7 @@ PASS NPOT cubemap with TEXTURE_MIN_FILTER set to LINEAR should draw.
 PASS getError was expected value: NO_ERROR : gl.texImage2D with POT texture at level 0 should succeed
 PASS POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR but no mips draw with 0,0,0,255
 PASS getError was expected value: NO_ERROR : gl.generateMipmap with POT texture should return succeed
+PASS POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/texture-npot.html b/LayoutTests/fast/canvas/webgl/texture-npot.html
index ac60cb5..fde02fc 100644
--- a/LayoutTests/fast/canvas/webgl/texture-npot.html
+++ b/LayoutTests/fast/canvas/webgl/texture-npot.html
@@ -188,11 +188,10 @@ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
 glErrorShouldBe(gl, gl.NO_ERROR,
     "gl.generateMipmap with POT texture should return succeed");
 
-// FIXME: add the test back once the bug is fixed.
-//wtu.drawQuad(gl);
-//wtu.checkCanvas(
-//    gl, [0, 192, 128, 255],
-//    "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
+wtu.drawQuad(gl);
+wtu.checkCanvas(
+    gl, [0, 192, 128, 255],
+    "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
 
 successfullyParsed = true;
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 86b8785..73293eb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-27  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Work around a Mac driver bug in generateMipmap
+        https://bugs.webkit.org/show_bug.cgi?id=48489
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::generateMipmap): Make sure minFilter is set to NEAREST_MIPMAP_LINEAR before generateMipmap, and after the call, set it back to the original value.
+        * html/canvas/WebGLTexture.h:
+        (WebCore::WebGLTexture::getMinFilter): Return the cached minFilter value.
+
 2010-10-28  Mikhail Naganov  <mnaganov at chromium.org>
 
         [Chromium clang] Unreviewed. Fix forward declaration of 'struct FileMetadata'.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 87fce53..a45aa1a 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -1151,7 +1151,20 @@ void WebGLRenderingContext::generateMipmap(unsigned long target)
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
+    // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LINEAR
+    // on Mac.  Remove the hack once this driver bug is fixed.
+#if OS(DARWIN)
+    bool needToResetMinFilter = false;
+    if (tex->getMinFilter() != GraphicsContext3D::NEAREST_MIPMAP_LINEAR) {
+        m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::NEAREST_MIPMAP_LINEAR);
+        needToResetMinFilter = true;
+    }
+#endif
     m_context->generateMipmap(target);
+#if OS(DARWIN)
+    if (needToResetMinFilter)
+        m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, tex->getMinFilter());
+#endif
     tex->generateMipmapLevelInfo();
     cleanupAfterGraphicsCall(false);
 }
diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h
index 191957d..6ee3dcc 100644
--- a/WebCore/html/canvas/WebGLTexture.h
+++ b/WebCore/html/canvas/WebGLTexture.h
@@ -44,6 +44,8 @@ public:
     void setParameteri(unsigned long pname, int param);
     void setParameterf(unsigned long pname, float param);
 
+    int getMinFilter() const { return m_minFilter; }
+
     void setLevelInfo(unsigned long target, int level, unsigned long internalFormat, int width, int height, unsigned long type);
 
     bool canGenerateMipmaps();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list