Changeset 70784 in webkit


Ignore:
Timestamp:
Oct 28, 2010 9:51:15 AM (13 years ago)
Author:
zmo@google.com
Message:

2010-10-27 Zhenyao Mo <zmo@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@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.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70783 r70784  
     12010-10-27  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Work around a Mac driver bug in generateMipmap
     6        https://bugs.webkit.org/show_bug.cgi?id=48489
     7
     8        * fast/canvas/webgl/texture-npot-expected.txt: Add back the failing part due to the generateMipmap Mac driver bug.
     9        * fast/canvas/webgl/texture-npot.html: Ditto.
     10
    1112010-10-28  Mikhail Naganov  <mnaganov@chromium.org>
    212
  • trunk/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt

    r65277 r70784  
    2525PASS POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR but no mips draw with 0,0,0,255
    2626PASS getError was expected value: NO_ERROR : gl.generateMipmap with POT texture should return succeed
     27PASS POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.
    2728PASS successfullyParsed is true
    2829
  • trunk/LayoutTests/fast/canvas/webgl/texture-npot.html

    r65277 r70784  
    189189    "gl.generateMipmap with POT texture should return succeed");
    190190
    191 // FIXME: add the test back once the bug is fixed.
    192 //wtu.drawQuad(gl);
    193 //wtu.checkCanvas(
    194 //    gl, [0, 192, 128, 255],
    195 //    "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
     191wtu.drawQuad(gl);
     192wtu.checkCanvas(
     193    gl, [0, 192, 128, 255],
     194    "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
    196195
    197196successfullyParsed = true;
  • trunk/WebCore/ChangeLog

    r70775 r70784  
     12010-10-27  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Work around a Mac driver bug in generateMipmap
     6        https://bugs.webkit.org/show_bug.cgi?id=48489
     7
     8        * html/canvas/WebGLRenderingContext.cpp:
     9        (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.
     10        * html/canvas/WebGLTexture.h:
     11        (WebCore::WebGLTexture::getMinFilter): Return the cached minFilter value.
     12
    1132010-10-28  Mikhail Naganov  <mnaganov@chromium.org>
    214
  • trunk/WebCore/html/canvas/WebGLRenderingContext.cpp

    r70663 r70784  
    11521152        return;
    11531153    }
     1154    // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LINEAR
     1155    // on Mac.  Remove the hack once this driver bug is fixed.
     1156#if OS(DARWIN)
     1157    bool needToResetMinFilter = false;
     1158    if (tex->getMinFilter() != GraphicsContext3D::NEAREST_MIPMAP_LINEAR) {
     1159        m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::NEAREST_MIPMAP_LINEAR);
     1160        needToResetMinFilter = true;
     1161    }
     1162#endif
    11541163    m_context->generateMipmap(target);
     1164#if OS(DARWIN)
     1165    if (needToResetMinFilter)
     1166        m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, tex->getMinFilter());
     1167#endif
    11551168    tex->generateMipmapLevelInfo();
    11561169    cleanupAfterGraphicsCall(false);
  • trunk/WebCore/html/canvas/WebGLTexture.h

    r66509 r70784  
    4444    void setParameteri(unsigned long pname, int param);
    4545    void setParameterf(unsigned long pname, float param);
     46
     47    int getMinFilter() const { return m_minFilter; }
    4648
    4749    void setLevelInfo(unsigned long target, int level, unsigned long internalFormat, int width, int height, unsigned long type);
Note: See TracChangeset for help on using the changeset viewer.