Changeset 57322 in webkit


Ignore:
Timestamp:
Apr 9, 2010 3:06:56 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-09 Zhenyao Mo <zmo@google.com>

Reviewed by Dimitri Glazkov.

Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
https://bugs.webkit.org/show_bug.cgi?id=37174

  • fast/canvas/webgl/copy-tex-image-and-sub-image-2d-expected.txt: Added.
  • fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html: Added.
  • fast/canvas/webgl/resources/utils3d.js: Add ContextAttributes parameter to initWebGL function.

2010-04-09 Zhenyao Mo <zmo@google.com>

Reviewed by Dimitri Glazkov.

Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
https://bugs.webkit.org/show_bug.cgi?id=37174

Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html

  • platform/graphics/mac/GraphicsContext3DMac.cpp: resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D. (WebCore::GraphicsContext3D::copyTexImage2D): (WebCore::GraphicsContext3D::copyTexSubImage2D):

2010-04-09 Zhenyao Mo <zmo@google.com>

Reviewed by Dimitri Glazkov.

Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
https://bugs.webkit.org/show_bug.cgi?id=37174

Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html

  • src/WebGraphicsContext3DDefaultImpl.cpp: Resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D. (WebKit::WebGraphicsContext3DDefaultImpl::copyTexImage2D): (WebKit::WebGraphicsContext3DDefaultImpl::copyTexSubImage2D):
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r57319 r57322  
     12010-04-09  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
     6        https://bugs.webkit.org/show_bug.cgi?id=37174
     7
     8        * fast/canvas/webgl/copy-tex-image-and-sub-image-2d-expected.txt: Added.
     9        * fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html: Added.
     10        * fast/canvas/webgl/resources/utils3d.js: Add ContextAttributes parameter to initWebGL function.
     11
    1122010-04-09  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    213
  • trunk/LayoutTests/fast/canvas/webgl/resources/utils3d.js

    r52056 r57322  
    1818// an empty function on other browsers.
    1919//
    20 function initWebGL(canvasName, vshader, fshader, attribs, clearColor, clearDepth)
     20function initWebGL(canvasName, vshader, fshader, attribs, clearColor, clearDepth, contextAttribs)
    2121{
    2222    var canvas = document.getElementById(canvasName);
    23     var gl = canvas.getContext("experimental-webgl");
     23    var gl = canvas.getContext("experimental-webgl", contextAttribs);
    2424    if (!gl) {
    2525        alert("No WebGL context found");
  • trunk/WebCore/ChangeLog

    r57321 r57322  
     12010-04-09  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
     6        https://bugs.webkit.org/show_bug.cgi?id=37174
     7
     8        Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
     9
     10        * platform/graphics/mac/GraphicsContext3DMac.cpp: resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D.
     11        (WebCore::GraphicsContext3D::copyTexImage2D):
     12        (WebCore::GraphicsContext3D::copyTexSubImage2D):
     13
    1142010-04-09  Evan Stade  <estade@chromium.org>
    215
  • trunk/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp

    r57018 r57322  
    500500{
    501501    ensureContext(m_contextObj);
     502    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
     503        ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
     504        ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
     505        ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
     506        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     507    }
    502508    ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
     509    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
     510        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
    503511}
    504512
     
    506514{
    507515    ensureContext(m_contextObj);
     516    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
     517        ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
     518        ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
     519        ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
     520        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     521    }
    508522    ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
     523    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
     524        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
    509525}
    510526
  • trunk/WebKit/chromium/ChangeLog

    r57220 r57322  
     12010-04-09  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
     6        https://bugs.webkit.org/show_bug.cgi?id=37174
     7
     8        Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
     9
     10        * src/WebGraphicsContext3DDefaultImpl.cpp: Resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D.
     11        (WebKit::WebGraphicsContext3DDefaultImpl::copyTexImage2D):
     12        (WebKit::WebGraphicsContext3DDefaultImpl::copyTexSubImage2D):
     13
    1142010-04-07  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp

    r57018 r57322  
    839839DELEGATE_TO_GL_1(compileShader, CompileShader, WebGLId)
    840840
    841 DELEGATE_TO_GL_8(copyTexImage2D, CopyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
    842 
    843 DELEGATE_TO_GL_8(copyTexSubImage2D, CopyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long)
     841void WebGraphicsContext3DDefaultImpl::copyTexImage2D(unsigned long target, long level, unsigned long internalformat,
     842                                                     long x, long y, unsigned long width, unsigned long height, long border)
     843{
     844    makeContextCurrent();
     845#ifndef RENDER_TO_DEBUGGING_WINDOW
     846    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) {
     847        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
     848        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
     849        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
     850        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     851    }
     852#endif
     853    glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
     854#ifndef RENDER_TO_DEBUGGING_WINDOW
     855    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
     856        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
     857#endif
     858}
     859
     860void WebGraphicsContext3DDefaultImpl::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset,
     861                                                        long x, long y, unsigned long width, unsigned long height)
     862{
     863    makeContextCurrent();
     864#ifndef RENDER_TO_DEBUGGING_WINDOW
     865    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) {
     866        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
     867        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
     868        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
     869        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     870    }
     871#endif
     872    glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
     873#ifndef RENDER_TO_DEBUGGING_WINDOW
     874    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
     875        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
     876#endif
     877}
    844878
    845879DELEGATE_TO_GL_1(cullFace, CullFace, unsigned long)
Note: See TracChangeset for help on using the changeset viewer.