2010-10-26  Kenneth Russell  <kbr@google.com>

        Reviewed by Andreas Kling.

        Valgrind failure in GraphicsContext3DInternal::reshape
        https://bugs.webkit.org/show_bug.cgi?id=48284

        * src/WebGraphicsContext3DDefaultImpl.cpp:
        (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):


git-svn-id: svn://svn.chromium.org/blink/trunk@70534 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer(unsigned x, unsigned y, unsigned width, unsigned height)
{
    if (m_attributes.antialias) {
        bool mustRestoreFBO = (m_boundFBO != m_multisampleFBO);
        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
        if (mustRestoreFBO)
            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
    }
}

void WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer(unsigned x, unsigned y, unsigned width, unsigned height)
{
    if (m_attributes.antialias) {
        bool mustRestoreFBO = (m_boundFBO != m_multisampleFBO);
        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
        if (mustRestoreFBO)
            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
    }
}
