[EFL][WebGL] Refactor GLPlatformSurface.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Feb 2013 16:55:20 +0000 (16:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Feb 2013 16:55:20 +0000 (16:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110616

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-02-23
Reviewed by Kenneth Rohde Christiansen.

Covered by existing WebGL tests.

With recent changes, there is a clear separation between
transport surface and off-screen surface. PlatformSurface
has the logic to render content to transport surface.
We currently rely on EXT_framebuffer_blit for this. This
extension is not exposed on GLES2.0. PlatformSurface was
supposed to be an abstraction layer without any knowledge
of the type of surface. This patch addresses the issues
in PlatformSurface class. We use shaders to draw texture
content to the surface. Any transport surface related
code in PlatformSurface is moved to GLTransportSurface class.

* PlatformEfl.cmake:
* platform/graphics/efl/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::didResizeCanvas):
* platform/graphics/surfaces/GLTransportSurface.cpp: Added.
(WebCore):
(WebCore::GLTransportSurface::GLTransportSurface):
(WebCore::GLTransportSurface::~GLTransportSurface):
(WebCore::GLTransportSurface::updateContents):
(WebCore::GLTransportSurface::setGeometry):
(WebCore::GLTransportSurface::destroy):
(WebCore::GLTransportSurface::draw):
(WebCore::GLTransportSurface::bindArrayBuffer):
(WebCore::GLTransportSurface::updateTransformationMatrix):
(WebCore::GLTransportSurface::initializeShaderProgram):
* platform/graphics/surfaces/GLTransportSurface.h:
(WebCore):
(GLTransportSurface):
* platform/graphics/surfaces/egl/EGLSurface.cpp:
(WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
(WebCore::EGLWindowTransportSurface::destroy):
(WebCore::EGLWindowTransportSurface::setGeometry):
* platform/graphics/surfaces/egl/EGLSurface.h:
* platform/graphics/surfaces/glx/GLXSurface.cpp:
(WebCore::GLXTransportSurface::GLXTransportSurface):
(WebCore::GLXTransportSurface::setGeometry):
(WebCore::GLXTransportSurface::destroy):
(WebCore::GLXOffScreenSurface::freeResources):
* platform/graphics/surfaces/glx/GLXSurface.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143842 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp
Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h
Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h [new file with mode: 0644]
Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp
Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h
Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp
Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.h

index d94d5d3..7c5bceb 100644 (file)
@@ -1,3 +1,52 @@
+2013-02-23  Kondapally Kalyan  <kalyan.kondapally@intel.com>
+
+        [EFL][WebGL] Refactor GLPlatformSurface.
+        https://bugs.webkit.org/show_bug.cgi?id=110616
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Covered by existing WebGL tests.
+        With recent changes, there is a clear separation between 
+        transport surface and off-screen surface. PlatformSurface 
+        has the logic to render content to transport surface. 
+        We currently rely on EXT_framebuffer_blit for this. This 
+        extension is not exposed on GLES2.0. PlatformSurface was 
+        supposed to be an abstraction layer without any knowledge 
+        of the type of surface. This patch addresses the issues 
+        in PlatformSurface class. We use shaders to draw texture 
+        content to the surface. Any transport surface related 
+        code in PlatformSurface is moved to GLTransportSurface class.
+
+        * PlatformEfl.cmake:
+        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
+        (WebCore::GraphicsContext3DPrivate::didResizeCanvas):
+        * platform/graphics/surfaces/GLTransportSurface.cpp: Added.
+        (WebCore):
+        (WebCore::GLTransportSurface::GLTransportSurface):
+        (WebCore::GLTransportSurface::~GLTransportSurface):
+        (WebCore::GLTransportSurface::updateContents):
+        (WebCore::GLTransportSurface::setGeometry):
+        (WebCore::GLTransportSurface::destroy):
+        (WebCore::GLTransportSurface::draw):
+        (WebCore::GLTransportSurface::bindArrayBuffer):
+        (WebCore::GLTransportSurface::updateTransformationMatrix):
+        (WebCore::GLTransportSurface::initializeShaderProgram):
+        * platform/graphics/surfaces/GLTransportSurface.h:
+        (WebCore):
+        (GLTransportSurface):
+        * platform/graphics/surfaces/egl/EGLSurface.cpp:
+        (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
+        (WebCore::EGLWindowTransportSurface::destroy):
+        (WebCore::EGLWindowTransportSurface::setGeometry):
+        * platform/graphics/surfaces/egl/EGLSurface.h:
+        * platform/graphics/surfaces/glx/GLXSurface.cpp:
+        (WebCore::GLXTransportSurface::GLXTransportSurface):
+        (WebCore::GLXTransportSurface::setGeometry):
+        (WebCore::GLXTransportSurface::destroy):
+        (WebCore::GLXOffScreenSurface::freeResources):
+        * platform/graphics/surfaces/glx/GLXSurface.h:
+
 2013-02-23  Hajime Morrita  <morrita@google.com>
 
         ShadowRoot needs guardRef() and guardDeref()
index feabc21..d1d463f 100644 (file)
@@ -313,6 +313,7 @@ if (WTF_USE_3D_GRAPHICS)
         platform/graphics/opengl/GLPlatformContext.cpp
         platform/graphics/opengl/GLPlatformSurface.cpp
         platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
+        platform/graphics/surfaces/GLTransportSurface.cpp
         platform/graphics/surfaces/GraphicsSurface.cpp
         platform/graphics/surfaces/glx/X11Helper.cpp
         platform/graphics/texmap/TextureMapperGL.cpp
index 934277b..c1935ca 100644 (file)
@@ -222,7 +222,9 @@ bool GraphicsContext3DPrivate::makeSharedContextCurrent() const
 void GraphicsContext3DPrivate::didResizeCanvas(const IntSize& size)
 {
     m_size = size;
-    m_sharedSurface->setGeometry(IntRect(0, 0, m_size.width(), m_size.height()));
+
+    if (makeSharedContextCurrent())
+        m_sharedSurface->setGeometry(IntRect(0, 0, m_size.width(), m_size.height()));
 }
 
 uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface()
index 55ddbff..84b4fe8 100644 (file)
@@ -69,8 +69,7 @@ PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createTransportSurface(SurfaceA
 }
 
 GLPlatformSurface::GLPlatformSurface(SurfaceAttributes)
-    : m_fboId(0)
-    , m_sharedDisplay(0)
+    : m_sharedDisplay(0)
     , m_drawable(0)
     , m_bufferHandle(0)
 {
@@ -110,40 +109,16 @@ void GLPlatformSurface::swapBuffers()
     notImplemented();
 }
 
-void GLPlatformSurface::updateContents(const uint32_t texture)
+void GLPlatformSurface::updateContents(const uint32_t)
 {
-    if (!m_fboId)
-        glGenFramebuffers(1, &m_fboId);
-
-    int x = 0;
-    int y = 0;
-    int width = m_rect.width();
-    int height = m_rect.height();
-
-    glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fboId);
-    glBindTexture(GL_TEXTURE_2D, texture);
-    glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
-    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
-    // Use NEAREST as no scale is performed during the blit.
-    glBlitFramebuffer(x, y, width, height, x, y, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
-    swapBuffers();
 }
 
-void GLPlatformSurface::setGeometry(const IntRect& newRect)
+void GLPlatformSurface::setGeometry(const IntRect&)
 {
-    m_rect = newRect;
 }
 
 void GLPlatformSurface::destroy()
 {
-    m_rect = IntRect();
-
-    if (m_fboId) {
-        glBindFramebuffer(GL_FRAMEBUFFER, 0);
-        glBindTexture(GL_TEXTURE_2D, 0);
-        glDeleteFramebuffers(1, &m_fboId);
-        m_fboId = 0;
-    }
 }
 
 GLPlatformSurface::SurfaceAttributes GLPlatformSurface::attributes() const
index b5988fc..5d40c52 100644 (file)
@@ -31,7 +31,6 @@
 #include "GLDefs.h"
 #include "IntRect.h"
 #include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
 
 // Encapsulates a surface that can be rendered to with GL, hiding platform
 // specific management.
@@ -77,9 +76,9 @@ public:
     // Function does the following(in order):
     // a) Blits texture contents to back buffer.
     // b) Calls Swap Buffers.
-    virtual void updateContents(const uint32_t texture);
+    virtual void updateContents(const uint32_t);
 
-    virtual void setGeometry(const IntRect& newRect);
+    virtual void setGeometry(const IntRect&);
 
     virtual PlatformSurfaceConfig configuration();
 
@@ -87,11 +86,11 @@ public:
 
 protected:
     GLPlatformSurface(SurfaceAttributes);
-    IntRect m_rect;
-    GLuint m_fboId;
+
     PlatformDisplay m_sharedDisplay;
     PlatformDrawable m_drawable;
     PlatformBufferHandle m_bufferHandle;
+    IntRect m_rect;
 };
 
 }
@@ -99,3 +98,4 @@ protected:
 #endif
 
 #endif
+
diff --git a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp b/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp
new file mode 100644 (file)
index 0000000..4238a9b
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GLTransportSurface.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+namespace WebCore {
+
+static const GLfloat vertices[] = { 0, 0, 1, 0, 1, 1, 0, 1 };
+static bool vertexArrayObjectSupported = false;
+
+GLTransportSurface::GLTransportSurface(SurfaceAttributes attributes)
+    : GLPlatformSurface(attributes)
+    , m_vbo(0)
+    , m_vertexHandle(0)
+{
+}
+
+GLTransportSurface::~GLTransportSurface()
+{
+}
+
+void GLTransportSurface::updateContents(const uint32_t texture)
+{
+    if (!m_shaderProgram)
+        initializeShaderProgram();
+
+    draw(texture);
+    swapBuffers();
+}
+
+void GLTransportSurface::setGeometry(const IntRect& newRect)
+{
+    m_rect = newRect;
+
+    if (!m_shaderProgram)
+        return;
+
+    updateTransformationMatrix();
+}
+
+void GLTransportSurface::destroy()
+{
+    m_rect = IntRect();
+
+    ::glBindFramebuffer(GL_FRAMEBUFFER, 0);
+    ::glBindTexture(GL_TEXTURE_2D, 0);
+
+    if (!m_shaderProgram || !m_context3D)
+        return;
+
+    ::glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+    if (m_vbo)
+        ::glDeleteBuffers(1, &m_vbo);
+
+    if (m_vertexHandle) {
+        m_context3D->getExtensions()->bindVertexArrayOES(0);
+        m_context3D->getExtensions()->deleteVertexArrayOES(m_vertexHandle);
+    } else if (m_shaderProgram)
+        ::glDisableVertexAttribArray(m_shaderProgram->vertexLocation());
+
+    ::glUseProgram(0);
+
+    m_shaderProgram = nullptr;
+    m_context3D = nullptr;
+}
+
+void GLTransportSurface::draw(const uint32_t texture)
+{
+    if (!m_vertexHandle)
+        bindArrayBuffer();
+
+    ::glBindTexture(GL_TEXTURE_2D, texture);
+    ::glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+}
+
+void GLTransportSurface::bindArrayBuffer() const
+{
+    ::glEnableVertexAttribArray(m_shaderProgram->vertexLocation());
+    ::glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
+    ::glVertexAttribPointer(m_shaderProgram->vertexLocation(), 2, GraphicsContext3D::FLOAT, false, 0, 0);
+}
+
+void GLTransportSurface::updateTransformationMatrix()
+{
+    if (!m_shaderProgram)
+        return;
+
+    ::glViewport(m_rect.x(), m_rect.y(), m_rect.width(), m_rect.height());
+
+    FloatRect targetRect = FloatRect(m_rect);
+    TransformationMatrix identityMatrix;
+    TransformationMatrix matrix = TransformationMatrix(identityMatrix).multiply(TransformationMatrix::rectToRect(FloatRect(0, 0, 1, 1), targetRect));
+    m_shaderProgram->setMatrix(m_shaderProgram->modelViewMatrixLocation(), matrix);
+
+    // Taken from TextureMapperGL.
+    const float nearValue = 9999999;
+    const float farValue = -99999;
+
+    TransformationMatrix projectionMatrix = TransformationMatrix(2.0 / float(m_rect.width()), 0, 0, 0,
+        0, (-2.0) / float(m_rect.height()), 0, 0,
+        0, 0, -2.f / (farValue - nearValue), 0,
+        -1, 1, -(farValue + nearValue) / (farValue - nearValue), 1);
+
+    m_shaderProgram->setMatrix(m_shaderProgram->projectionMatrixLocation(), projectionMatrix);
+}
+
+void GLTransportSurface::initializeShaderProgram()
+{
+    if (!m_context3D)
+        m_context3D = GraphicsContext3D::createForCurrentGLContext();
+
+    vertexArrayObjectSupported = m_context3D->getExtensions()->supports("GL_OES_vertex_array_object");
+
+    TextureMapperShaderProgram::Options options = TextureMapperShaderProgram::Texture;
+    m_shaderProgram = TextureMapperShaderProgram::create(m_context3D, options);
+
+    ::glUseProgram(m_shaderProgram->programID());
+    ::glUniform1i(m_shaderProgram->samplerLocation(), 0);
+    ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+    ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+    ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+    TransformationMatrix flipTransform;
+    flipTransform.flipY();
+    flipTransform.translate(0, -1);
+    m_shaderProgram->setMatrix(m_shaderProgram->textureSpaceMatrixLocation(), flipTransform);
+
+    ::glUniform1f(m_shaderProgram->opacityLocation(), 1.0);
+
+    if (!m_vbo) {
+        ::glGenBuffers(1, &m_vbo);
+        ::glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
+        ::glBufferData(GL_ARRAY_BUFFER, sizeof(GC3Dfloat) * 8, vertices, GL_STATIC_DRAW);
+    }
+
+    // Create and set-up vertex array object.
+    if (vertexArrayObjectSupported) {
+        m_vertexHandle = m_context3D->getExtensions()->createVertexArrayOES();
+
+        if (m_vertexHandle) {
+            m_context3D->getExtensions()->bindVertexArrayOES(m_vertexHandle);
+            bindArrayBuffer();
+        }
+    }
+
+    updateTransformationMatrix();
+
+    ::glBindFramebuffer(GL_FRAMEBUFFER, 0);
+}
+
+}
+
+#endif
+
diff --git a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h b/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h
new file mode 100644 (file)
index 0000000..6cb9d10
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GLTransportSurface_h
+#define GLTransportSurface_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "GLPlatformSurface.h"
+#include <texmap/TextureMapperShaderProgram.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class GLTransportSurface : public GLPlatformSurface {
+
+public:
+    GLTransportSurface(SurfaceAttributes);
+    virtual ~GLTransportSurface();
+    virtual void updateContents(const uint32_t) OVERRIDE;
+    virtual void setGeometry(const IntRect&) OVERRIDE;
+    virtual void destroy() OVERRIDE;
+
+protected:
+    void updateTransformationMatrix();
+    void bindArrayBuffer() const;
+    void initializeShaderProgram();
+    void draw(const uint32_t);
+
+    RefPtr<GraphicsContext3D> m_context3D;
+    RefPtr<TextureMapperShaderProgram> m_shaderProgram;
+    Platform3DObject m_vbo;
+    Platform3DObject m_vertexHandle;
+};
+
+}
+
+#endif
+
+#endif
+
index eaf1300..89bf516 100644 (file)
@@ -31,7 +31,7 @@
 namespace WebCore {
 
 EGLWindowTransportSurface::EGLWindowTransportSurface(SurfaceAttributes attributes)
-    : GLPlatformSurface(attributes)
+    : GLTransportSurface(attributes)
 {
     m_configSelector = adoptPtr(new EGLConfigSelector(attributes, NativeWrapper::nativeDisplay()));
     m_sharedDisplay = m_configSelector->display();
@@ -106,7 +106,7 @@ void EGLWindowTransportSurface::swapBuffers()
 
 void EGLWindowTransportSurface::destroy()
 {
-    GLPlatformSurface::destroy();
+    GLTransportSurface::destroy();
     NativeWrapper::destroyWindow(m_bufferHandle);
     freeEGLResources();
     m_bufferHandle = 0;
@@ -130,7 +130,7 @@ void EGLWindowTransportSurface::freeEGLResources()
 
 void EGLWindowTransportSurface::setGeometry(const IntRect& newRect)
 {
-    GLPlatformSurface::setGeometry(newRect);
+    GLTransportSurface::setGeometry(newRect);
     NativeWrapper::resizeWindow(newRect, m_bufferHandle);
 }
 
index db1a21e..54bd24c 100644 (file)
@@ -29,7 +29,7 @@
 #if USE(EGL) && USE(GRAPHICS_SURFACE)
 
 #include "EGLConfigSelector.h"
-#include "GLPlatformSurface.h"
+#include "GLTransportSurface.h"
 
 #include <glx/X11Helper.h>
 #include <wtf/Noncopyable.h>
@@ -40,7 +40,7 @@ namespace WebCore {
 typedef X11Helper NativeWrapper;
 
 // Contents of the surface are backed by native window.
-class EGLWindowTransportSurface : public GLPlatformSurface {
+class EGLWindowTransportSurface : public GLTransportSurface {
 
 public:
     EGLWindowTransportSurface(SurfaceAttributes);
index 8ab7aa6..c0e5636 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 static const int pbufferAttributes[] = { GLX_PBUFFER_WIDTH, 1, GLX_PBUFFER_HEIGHT, 1, 0 };
 
 GLXTransportSurface::GLXTransportSurface(SurfaceAttributes attributes)
-    : GLPlatformSurface(attributes)
+    : GLTransportSurface(attributes)
 {
     m_sharedDisplay = X11Helper::nativeDisplay();
     attributes |= GLPlatformSurface::DoubleBuffered;
@@ -66,7 +66,7 @@ PlatformSurfaceConfig GLXTransportSurface::configuration()
 
 void GLXTransportSurface::setGeometry(const IntRect& newRect)
 {
-    GLPlatformSurface::setGeometry(newRect);
+    GLTransportSurface::setGeometry(newRect);
     X11Helper::resizeWindow(newRect, m_drawable);
     // Force resize of GL surface after window resize.
     glXSwapBuffers(sharedDisplay(), m_drawable);
@@ -82,7 +82,7 @@ void GLXTransportSurface::swapBuffers()
 
 void GLXTransportSurface::destroy()
 {
-    GLPlatformSurface::destroy();
+    GLTransportSurface::destroy();
 
     if (m_bufferHandle) {
         X11Helper::destroyWindow(m_bufferHandle);
@@ -146,7 +146,6 @@ void GLXOffScreenSurface::destroy()
 
 void GLXOffScreenSurface::freeResources()
 {
-    GLPlatformSurface::destroy();
     Display* display = sharedDisplay();
 
     if (!display)
index d7eac91..e861891 100644 (file)
 
 #if USE(ACCELERATED_COMPOSITING) && USE(GLX)
 
-#include "GLPlatformSurface.h"
+#include "GLTransportSurface.h"
 #include "GLXConfigSelector.h"
 #include "X11Helper.h"
 
 namespace WebCore {
 
-class GLXTransportSurface : public GLPlatformSurface {
+class GLXTransportSurface : public GLTransportSurface {
 
 public:
     GLXTransportSurface(SurfaceAttributes);