[Qt] Remove QOpenGL specific code from GraphicsSurfaceGLX.
https://bugs.webkit.org/show_bug.cgi?id=100492

This patch removes most of the QOpenGLContext related code
from GraphicsSurfaceGLX. This allows sharing almost all
GraphicsSurfaceGLX code with EFL, by relying on pure GLX.

Patch by Zeno Albisser <zeno@webkit.org> on 2012-10-26
Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
(WebCore::OffScreenRootWindow::get):
(WebCore::OffScreenRootWindow::~OffScreenRootWindow):
(OffScreenRootWindow):
(WebCore):
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::createSurface):
(WebCore::GraphicsSurfacePrivate::makeCurrent):
(WebCore::GraphicsSurfacePrivate::doneCurrent):
(WebCore::GraphicsSurfacePrivate::swapBuffers):
(WebCore::GraphicsSurfacePrivate::copyFromTexture):
(GraphicsSurfacePrivate):
(WebCore::resolveGLMethods):

git-svn-id: svn://svn.chromium.org/blink/trunk@132628 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    void swapBuffers()
    {
         if (m_xPixmap)
             return;
 
         GLXContext glContext = glXGetCurrentContext();
 
         if (m_surface && glContext) {
            GLint oldFBO;
            glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO);
            pGlBindFramebuffer(GL_FRAMEBUFFER, 0);
             glXSwapBuffers(m_display, m_surface);
             pGlBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
         }
     }

    void swapBuffers()
    {
         if (m_xPixmap)
             return;
 
#if PLATFORM(QT)
        if (!m_surface->isVisible())
            return;
        while (!m_surface->isExposed())
            QCoreApplication::processEvents();
        QOpenGLContext* glContext = QOpenGLContext::currentContext();
        if (m_surface && glContext) {
            GLint oldFBO;
            glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO);
            pGlBindFramebuffer(GL_FRAMEBUFFER, glContext->defaultFramebufferObject());
            glContext->swapBuffers(m_surface.get());
            pGlBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
        }
#elif PLATFORM(EFL)
         GLXContext glContext = glXGetCurrentContext();
 
         if (m_surface && glContext) {
            GLint oldFBO;
            glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO);
            pGlBindFramebuffer(GL_FRAMEBUFFER, 0);
             glXSwapBuffers(m_display, m_surface);
             pGlBindFramebuffer(GL_FRAMEBUFFER, oldFBO);
         }
#endif
     }
