[GTK] Add support for creating EGL contexts
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 17:54:57 +0000 (17:54 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 17:54:57 +0000 (17:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77921

Patch by José Dapena Paz <jdapena@igalia.com> on 2012-10-05
Reviewed by Martin Robinson.

This patch adds support for EGL, using OpenGL and OpenGL ES 2. Both
options are set up on compile time, with the configure options
--enable-egl and --enable-gles2.

The implementation only adds support for EGL on top of X11, to
isolate the changes to the minimum. More changes should come
later to enable EGL for other targets (as Wayland).

.:

* GNUmakefile.am:
* configure.ac: new configure options --enable-egl and --enable-gles2.

Source/WebCore:

No new tests required, as existing WebGL and AC tests should cover
the cases.

* GNUmakefile.am:
* GNUmakefile.list.am:
* platform/graphics/GraphicsContext3D.h:
(GraphicsContext3D):
* platform/graphics/OpenGLESShims.h:
* platform/graphics/cairo/GLContext.cpp:
(WebCore):
(WebCore::GLContext::sharedX11Display):
(WebCore::GLContext::cleanupSharedX11Display):
(WebCore::activeContextList):
(WebCore::GLContext::addActiveContext):
(WebCore::GLContext::removeActiveContext):
(WebCore::GLContext::cleanupActiveContextsAtExit):
(WebCore::GLContext::createContextForWindow):
(WebCore::GLContext::createOffscreenContext):
* platform/graphics/cairo/GLContext.h:
(GLContext):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant):
* platform/graphics/cairo/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
* platform/graphics/clutter/GraphicsContext3DClutter.cpp:
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
* platform/graphics/egl/GLContextEGL.cpp: Added.
(WebCore):
(WebCore::sharedEGLDisplay):
(WebCore::getEGLConfig):
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createPbufferContext):
(WebCore::GLContextEGL::createPixmapContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::~GLContextEGL):
(WebCore::GLContextEGL::canRenderToDefaultFramebuffer):
(WebCore::GLContextEGL::defaultFrameBufferSize):
(WebCore::GLContextEGL::makeContextCurrent):
(WebCore::GLContextEGL::swapBuffers):
(WebCore::GLContextEGL::waitNative):
(WebCore::GLContextEGL::platformContext):
* platform/graphics/egl/GLContextEGL.h: Added.
(WebCore):
(GLContextEGL):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::createWindowContext):
(WebCore::GLContextGLX::createPbufferContext):
(WebCore::GLContextGLX::createPixmapContext):
(WebCore::GLContextGLX::createContext):
(WebCore::GLContextGLX::~GLContextGLX):
(WebCore::GLContextGLX::defaultFrameBufferSize):
(WebCore::GLContextGLX::makeContextCurrent):
(WebCore::GLContextGLX::swapBuffers):
(WebCore):
(WebCore::GLContextGLX::waitNative):
* platform/graphics/glx/GLContextGLX.h:
(GLContextGLX):
* platform/graphics/mac/GraphicsContext3DMac.mm:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::releaseShaderCompiler):
(WebCore):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::readPixels):
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::renderbufferStorage):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
* platform/graphics/texmap/TextureMapper.h:
* platform/gtk/RedirectedXCompositeWindow.cpp:
(WebCore::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
(WebCore::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
(WebCore::RedirectedXCompositeWindow::resize):
* platform/gtk/RedirectedXCompositeWindow.h:

Source/WebKit2:

* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:

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

27 files changed:
ChangeLog
GNUmakefile.am
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/OpenGLESShims.h
Source/WebCore/platform/graphics/cairo/GLContext.cpp
Source/WebCore/platform/graphics/cairo/GLContext.h
Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/clutter/GraphicsContext3DClutter.cpp
Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/egl/GLContextEGL.h [new file with mode: 0644]
Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
Source/WebCore/platform/graphics/glx/GLContextGLX.h
Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp
Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
configure.ac

index 74e971a..1ed1a1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-10-05  José Dapena Paz  <jdapena@igalia.com>
+
+        [GTK] Add support for creating EGL contexts
+        https://bugs.webkit.org/show_bug.cgi?id=77921
+
+        Reviewed by Martin Robinson.
+
+        This patch adds support for EGL, using OpenGL and OpenGL ES 2. Both
+        options are set up on compile time, with the configure options
+        --enable-egl and --enable-gles2.
+
+        The implementation only adds support for EGL on top of X11, to
+        isolate the changes to the minimum. More changes should come
+        later to enable EGL for other targets (as Wayland).
+
+        * GNUmakefile.am:
+        * configure.ac: new configure options --enable-egl and --enable-gles2.
+
 2012-10-04  Rob Buis  <rbuis@rim.com>
 
         [BlackBerry] Sync up CMake files
index 2be3edf..6fe667e 100644 (file)
@@ -237,6 +237,16 @@ global_cppflags += \
        -DWTF_USE_GLX=1
 endif
 
+if USE_EGL
+global_cppflags += \
+       -DWTF_USE_EGL=1
+endif
+
+if USE_GLES2
+global_cppflags += \
+       -DWTF_USE_OPENGL_ES_2=1
+endif
+
 if USE_OPENGL
 global_cppflags += \
        -DWTF_USE_OPENGL=1
index 93f8a63..013bb2e 100644 (file)
@@ -1,3 +1,95 @@
+2012-10-05  José Dapena Paz  <jdapena@igalia.com>
+
+        [GTK] Add support for creating EGL contexts
+        https://bugs.webkit.org/show_bug.cgi?id=77921
+
+        Reviewed by Martin Robinson.
+
+        This patch adds support for EGL, using OpenGL and OpenGL ES 2. Both
+        options are set up on compile time, with the configure options
+        --enable-egl and --enable-gles2.
+
+        The implementation only adds support for EGL on top of X11, to
+        isolate the changes to the minimum. More changes should come
+        later to enable EGL for other targets (as Wayland).
+
+        No new tests required, as existing WebGL and AC tests should cover
+        the cases.
+
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * platform/graphics/GraphicsContext3D.h:
+        (GraphicsContext3D):
+        * platform/graphics/OpenGLESShims.h:
+        * platform/graphics/cairo/GLContext.cpp:
+        (WebCore):
+        (WebCore::GLContext::sharedX11Display):
+        (WebCore::GLContext::cleanupSharedX11Display):
+        (WebCore::activeContextList):
+        (WebCore::GLContext::addActiveContext):
+        (WebCore::GLContext::removeActiveContext):
+        (WebCore::GLContext::cleanupActiveContextsAtExit):
+        (WebCore::GLContext::createContextForWindow):
+        (WebCore::GLContext::createOffscreenContext):
+        * platform/graphics/cairo/GLContext.h:
+        (GLContext):
+        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::isGLES2Compliant):
+        * platform/graphics/cairo/GraphicsContext3DPrivate.cpp:
+        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
+        * platform/graphics/clutter/GraphicsContext3DClutter.cpp:
+        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+        * platform/graphics/egl/GLContextEGL.cpp: Added.
+        (WebCore):
+        (WebCore::sharedEGLDisplay):
+        (WebCore::getEGLConfig):
+        (WebCore::GLContextEGL::createWindowContext):
+        (WebCore::GLContextEGL::createPbufferContext):
+        (WebCore::GLContextEGL::createPixmapContext):
+        (WebCore::GLContextEGL::createContext):
+        (WebCore::GLContextEGL::GLContextEGL):
+        (WebCore::GLContextEGL::~GLContextEGL):
+        (WebCore::GLContextEGL::canRenderToDefaultFramebuffer):
+        (WebCore::GLContextEGL::defaultFrameBufferSize):
+        (WebCore::GLContextEGL::makeContextCurrent):
+        (WebCore::GLContextEGL::swapBuffers):
+        (WebCore::GLContextEGL::waitNative):
+        (WebCore::GLContextEGL::platformContext):
+        * platform/graphics/egl/GLContextEGL.h: Added.
+        (WebCore):
+        (GLContextEGL):
+        * platform/graphics/glx/GLContextGLX.cpp:
+        (WebCore::GLContextGLX::createWindowContext):
+        (WebCore::GLContextGLX::createPbufferContext):
+        (WebCore::GLContextGLX::createPixmapContext):
+        (WebCore::GLContextGLX::createContext):
+        (WebCore::GLContextGLX::~GLContextGLX):
+        (WebCore::GLContextGLX::defaultFrameBufferSize):
+        (WebCore::GLContextGLX::makeContextCurrent):
+        (WebCore::GLContextGLX::swapBuffers):
+        (WebCore):
+        (WebCore::GLContextGLX::waitNative):
+        * platform/graphics/glx/GLContextGLX.h:
+        (GLContextGLX):
+        * platform/graphics/mac/GraphicsContext3DMac.mm:
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::releaseShaderCompiler):
+        (WebCore):
+        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
+        (WebCore::GraphicsContext3D::readPixels):
+        (WebCore::GraphicsContext3D::reshapeFBOs):
+        (WebCore::GraphicsContext3D::renderbufferStorage):
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        * platform/graphics/texmap/TextureMapper.h:
+        * platform/gtk/RedirectedXCompositeWindow.cpp:
+        (WebCore::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
+        (WebCore::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
+        (WebCore::RedirectedXCompositeWindow::resize):
+        * platform/gtk/RedirectedXCompositeWindow.h:
+
 2012-10-04  Jon Lee  <jonlee@apple.com>
 
         Add a setting to enable plugin snapshotting
index 39088f3..5ce8595 100644 (file)
@@ -112,6 +112,7 @@ webcoregtk_cppflags += \
        -I$(srcdir)/Source/WebCore/platform/geoclue \
        -I$(srcdir)/Source/WebCore/platform/graphics/cairo \
        -I$(srcdir)/Source/WebCore/platform/graphics/glx \
+       -I$(srcdir)/Source/WebCore/platform/graphics/egl \
        -I$(srcdir)/Source/WebCore/platform/graphics/gstreamer \
        -I$(srcdir)/Source/WebCore/platform/graphics/gtk \
        -I$(srcdir)/Source/WebCore/platform/gtk \
index b88f9dc..1e97b57 100644 (file)
@@ -4457,14 +4457,9 @@ webcore_sources += \
        Source/WebCore/platform/graphics/MediaPlayer.cpp \
        Source/WebCore/platform/graphics/MediaPlayer.h \
        Source/WebCore/platform/graphics/MediaPlayerPrivate.h \
-       Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \
-       Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \
        Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp \
        Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h \
-       Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
        Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \
-       Source/WebCore/platform/graphics/OpenGLShims.cpp \
-       Source/WebCore/platform/graphics/OpenGLShims.h \
        Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.h \
        Source/WebCore/platform/graphics/Path.cpp \
        Source/WebCore/platform/graphics/Path.h \
@@ -5996,8 +5991,6 @@ webcoregtk_sources += \
 
 if TARGET_X11
 webcoregtk_sources += \
-       Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \
-       Source/WebCore/platform/graphics/glx/GLContextGLX.h \
        Source/WebCore/platform/graphics/cairo/GLContext.cpp \
        Source/WebCore/platform/graphics/cairo/GLContext.h \
        Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \
@@ -6008,6 +6001,16 @@ webcoregtk_sources += \
        Source/WebCore/plugins/gtk/PluginPackageGtk.cpp \
        Source/WebCore/plugins/gtk/PluginViewGtk.cpp \
        Source/WebCore/plugins/gtk/xembed.h
+if USE_EGL
+webcoregtk_sources += \
+       Source/WebCore/platform/graphics/egl/GLContextEGL.cpp \
+       Source/WebCore/platform/graphics/egl/GLContextEGL.h
+endif # END USE_EGL
+if USE_GLX
+webcoregtk_sources += \
+       Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \
+       Source/WebCore/platform/graphics/glx/GLContextGLX.h
+endif # END USE_GLX
 else
 if TARGET_WIN32
 webcore_sources += \
@@ -6038,6 +6041,21 @@ webcore_sources += \
 endif # END TARGET_WIN32
 endif # END TARGET_X11
 
+if USE_GLES2
+webcore_sources += \
+       Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp \
+       Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h \
+       Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp \
+       Source/WebCore/platform/graphics/OpenGLESShims.h
+else
+webcore_sources += \
+       Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \
+       Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \
+       Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \
+       Source/WebCore/platform/graphics/OpenGLShims.cpp \
+       Source/WebCore/platform/graphics/OpenGLShims.h
+endif # END USE_GLES2
+
 # ----
 # icu unicode backend
 # ----
index 4dcb2d0..8608234 100644 (file)
@@ -395,6 +395,7 @@ public:
         STENCIL_INDEX8 = 0x8D48,
         DEPTH_STENCIL = 0x84F9,
         UNSIGNED_INT_24_8 = 0x84FA,
+        DEPTH24_STENCIL8 = 0x88F0,
         RENDERBUFFER_WIDTH = 0x8D42,
         RENDERBUFFER_HEIGHT = 0x8D43,
         RENDERBUFFER_INTERNAL_FORMAT = 0x8D44,
@@ -1021,7 +1022,7 @@ public:
     ANGLEWebKitBridge m_compiler;
 #endif
 
-#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2))
+#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || (PLATFORM(GTK) && USE(OPENGL_ES_2))
     friend class Extensions3DOpenGLES;
     OwnPtr<Extensions3DOpenGLES> m_extensions;
 #elif !PLATFORM(CHROMIUM)
index 4018700..bcaf855 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef OpenGLESShims_h
 #define OpenGLESShims_h
 
-#if PLATFORM(BLACKBERRY) || PLATFORM(QT)
+#if PLATFORM(BLACKBERRY) || PLATFORM(QT) || PLATFORM(GTK)
 #define glBindFramebufferEXT glBindFramebuffer
 #define glFramebufferTexture2DEXT glFramebufferTexture2D
 #define glBindRenderbufferEXT glBindRenderbuffer
index 3b804f6..2cb0ab3 100644 (file)
 
 #if USE(OPENGL)
 
+#include "GLContextEGL.h"
+#include "GLContextGLX.h"
 #include <wtf/MainThread.h>
 
-#if USE(GLX)
-#include "GLContextGLX.h"
+#if PLATFORM(X11)
+#include <X11/Xlib.h>
 #endif
 
 namespace WebCore {
@@ -36,22 +38,106 @@ GLContext* GLContext::sharingContext()
     return sharing.get();
 }
 
+#if PLATFORM(X11)
+// We do not want to call glXMakeContextCurrent using different Display pointers,
+// because it might lead to crashes in some drivers (fglrx). We use a shared display
+// pointer here.
+static Display* gSharedX11Display = 0;
+Display* GLContext::sharedX11Display()
+{
+    if (!gSharedX11Display)
+        gSharedX11Display = XOpenDisplay(0);
+    return gSharedX11Display;
+}
+
+void GLContext::cleanupSharedX11Display()
+{
+    if (!gSharedX11Display)
+        return;
+    XCloseDisplay(gSharedX11Display);
+    gSharedX11Display = 0;
+}
+#endif // PLATFORM(X11)
+
+// Because of driver bugs, exiting the program when there are active pbuffers
+// can crash the X server (this has been observed with the official Nvidia drivers).
+// We need to ensure that we clean everything up on exit. There are several reasons
+// that GraphicsContext3Ds will still be alive at exit, including user error (memory
+// leaks) and the page cache. In any case, we don't want the X server to crash.
+typedef Vector<GLContext*> ActiveContextList;
+static ActiveContextList& activeContextList()
+{
+    DEFINE_STATIC_LOCAL(ActiveContextList, activeContexts, ());
+    return activeContexts;
+}
+
+void GLContext::addActiveContext(GLContext* context)
+{
+    static bool addedAtExitHandler = false;
+    if (!addedAtExitHandler) {
+        atexit(&GLContext::cleanupActiveContextsAtExit);
+        addedAtExitHandler = true;
+    }
+    activeContextList().append(context);
+}
+
+static bool gCleaningUpAtExit = false;
+
+void GLContext::removeActiveContext(GLContext* context)
+{
+    // If we are cleaning up the context list at exit, don't bother removing the context
+    // from the list, since we don't want to modify the list while it's being iterated.
+    if (gCleaningUpAtExit)
+        return;
+
+    ActiveContextList& contextList = activeContextList();
+    size_t i = contextList.find(context);
+    if (i != notFound)
+        contextList.remove(i);
+}
+
+void GLContext::cleanupActiveContextsAtExit()
+{
+    gCleaningUpAtExit = true;
+
+    ActiveContextList& contextList = activeContextList();
+    for (size_t i = 0; i < contextList.size(); ++i)
+        delete contextList[i];
+
+#if PLATFORM(X11)
+    cleanupSharedX11Display();
+#endif
+}
+
+
+
 PassOwnPtr<GLContext> GLContext::createContextForWindow(uint64_t windowHandle, GLContext* sharingContext)
 {
 #if USE(GLX)
-    return GLContextGLX::createContext(windowHandle, sharingContext);
+    if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(windowHandle, sharingContext))
+        return glxContext.release();
+#endif
+#if USE(EGL)
+    if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
+        return eglContext.release();
 #endif
     return nullptr;
 }
 
 GLContext::GLContext()
 {
+    addActiveContext(this);
 }
 
-PassOwnPtr<GLContext> GLContext::createOffscreenContext(GLContext* sharing)
+PassOwnPtr<GLContext> GLContext::createOffscreenContext(GLContext* sharingContext)
 {
 #if USE(GLX)
-    return GLContextGLX::createContext(0, sharing);
+    if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(0, sharingContext))
+        return glxContext.release();
+#endif
+#if USE(EGL)
+    if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(0, sharingContext))
+        return eglContext.release();
 #endif
     return nullptr;
 }
@@ -64,6 +150,7 @@ GLContext::~GLContext()
 {
     if (this == gCurrentContext)
         gCurrentContext = 0;
+    removeActiveContext(this);
 }
 
 bool GLContext::makeContextCurrent()
index c23a46c..1a88072 100644 (file)
 #include <wtf/Noncopyable.h>
 #include <wtf/PassOwnPtr.h>
 
+#if PLATFORM(X11)
+typedef struct _XDisplay Display;
+#endif
+
 namespace WebCore {
 
 class GLContext {
@@ -39,9 +43,19 @@ public:
     virtual ~GLContext();
     virtual bool makeContextCurrent();
     virtual void swapBuffers() = 0;
+    virtual void waitNative() = 0;
     virtual bool canRenderToDefaultFramebuffer() = 0;
     virtual IntSize defaultFrameBufferSize() = 0;
 
+#if PLATFORM(X11)
+    static Display* sharedX11Display();
+    static void cleanupSharedX11Display();
+#endif
+
+    static void addActiveContext(GLContext*);
+    static void removeActiveContext(GLContext*);
+    static void cleanupActiveContextsAtExit();
+
 #if USE(3D_GRAPHICS)
     virtual PlatformGraphicsContext3D platformContext() = 0;
 #endif
index dc12f6c..7033fa6 100644 (file)
 
 #if USE(3D_GRAPHICS)
 
-#include "Extensions3DOpenGL.h"
 #include "GraphicsContext3DPrivate.h"
 #include "Image.h"
 #include "ImageSource.h"
 #include "NotImplemented.h"
-#include "OpenGLShims.h"
 #include "PlatformContextCairo.h"
 #include "RefPtrCairo.h"
 #include "ShaderLang.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 
+#if USE(OPENGL_ES_2)
+#include "Extensions3DOpenGLES.h"
+#else
+#include "Extensions3DOpenGL.h"
+#include "OpenGLShims.h"
+#endif
+
 namespace WebCore {
 
 PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
@@ -55,7 +60,9 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri
     static bool initialized = false;
     static bool success = true;
     if (!initialized) {
+#if !USE(OPENGL_ES_2)
         success = initializeOpenGLShims();
+#endif
         initialized = true;
     }
     if (!success)
@@ -90,26 +97,26 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, H
         ::glBindTexture(GL_TEXTURE_2D, m_texture);
         ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
         ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
         ::glBindTexture(GL_TEXTURE_2D, 0);
 
         // Create an FBO.
-        ::glGenFramebuffersEXT(1, &m_fbo);
-        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        ::glGenFramebuffers(1, &m_fbo);
+        ::glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
 
         m_boundFBO = m_fbo;
         if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth))
-            ::glGenRenderbuffersEXT(1, &m_depthStencilBuffer);
+            ::glGenRenderbuffers(1, &m_depthStencilBuffer);
 
         // Create a multisample FBO.
         if (m_attrs.antialias) {
-            ::glGenFramebuffersEXT(1, &m_multisampleFBO);
-            ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+            ::glGenFramebuffers(1, &m_multisampleFBO);
+            ::glBindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
             m_boundFBO = m_multisampleFBO;
-            ::glGenRenderbuffersEXT(1, &m_multisampleColorBuffer);
+            ::glGenRenderbuffers(1, &m_multisampleColorBuffer);
             if (m_attrs.stencil || m_attrs.depth)
-                ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
+                ::glGenRenderbuffers(1, &m_multisampleDepthStencilBuffer);
         }
     }
 
@@ -129,8 +136,11 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, H
     ANGLEResources.MaxDrawBuffers = 1;
     m_compiler.setResources(ANGLEResources);
 
+#if !USE(OPENGL_ES_2)
     ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
     ::glEnable(GL_POINT_SPRITE);
+#endif
+
     ::glClearColor(0, 0, 0, 0);
 }
 
@@ -142,20 +152,15 @@ GraphicsContext3D::~GraphicsContext3D()
     makeContextCurrent();
     ::glDeleteTextures(1, &m_texture);
     if (m_attrs.antialias) {
-        ::glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer);
+        ::glDeleteRenderbuffers(1, &m_multisampleColorBuffer);
         if (m_attrs.stencil || m_attrs.depth)
-            ::glDeleteRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
-        ::glDeleteFramebuffersEXT(1, &m_multisampleFBO);
+            ::glDeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer);
+        ::glDeleteFramebuffers(1, &m_multisampleFBO);
     } else {
         if (m_attrs.stencil || m_attrs.depth)
-            ::glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
+            ::glDeleteRenderbuffers(1, &m_depthStencilBuffer);
     }
-    ::glDeleteFramebuffersEXT(1, &m_fbo);
-}
-
-void GraphicsContext3D::releaseShaderCompiler()
-{
-    notImplemented();
+    ::glDeleteFramebuffers(1, &m_fbo);
 }
 
 bool GraphicsContext3D::getImageData(Image* image, unsigned int format, unsigned int type, bool premultiplyAlpha, bool ignoreGammaAndColorProfile, Vector<uint8_t>& outputVector)
@@ -258,7 +263,11 @@ PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
 
 bool GraphicsContext3D::isGLES2Compliant() const
 {
+#if USE(OPENGL_ES_2)
+    return true;
+#else
     return false;
+#endif
 }
 
 #if USE(ACCELERATED_COMPOSITING)
index d88242f..294169e 100644 (file)
 
 #include "HostWindow.h"
 #include "NotImplemented.h"
-#include "OpenGLShims.h"
 #include "PlatformContextCairo.h"
 #include <wtf/OwnArrayPtr.h>
 
+#if USE(OPENGL_ES_2)
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#else
+#include "OpenGLShims.h"
+#endif
+
 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) && USE(TEXTURE_MAPPER_GL)
 #include <texmap/TextureMapperGL.h>
 #endif
@@ -125,7 +131,7 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper
             m_context->makeContextCurrent();
 
         m_context->resolveMultisamplingIfNecessary();
-        glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_boundFBO);
+        ::glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_boundFBO);
 
         if (previousActiveContext && previousActiveContext != m_glContext)
             previousActiveContext->makeContextCurrent();
index abfbd47..7df1ee9 100644 (file)
@@ -56,11 +56,6 @@ GraphicsContext3D::~GraphicsContext3D()
     notImplemented();
 }
 
-void GraphicsContext3D::releaseShaderCompiler()
-{
-    notImplemented();
-}
-
 bool GraphicsContext3D::getImageData(Image* image, unsigned int format, unsigned int type, bool premultiplyAlpha, bool ignoreGammaAndColorProfile, Vector<uint8_t>& outputVector)
 {
     notImplemented();
index 721d7c7..b5f1415 100644 (file)
@@ -474,11 +474,6 @@ void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsi
     m_private->readPixels(x, y, width, height, format, type, data);
 }
 
-void GraphicsContext3D::releaseShaderCompiler()
-{
-    notImplemented();
-}
-
 void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
 {
     m_private->renderbufferStorage(target, internalformat, width, height);
diff --git a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp b/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
new file mode 100644 (file)
index 0000000..b9389b4
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * Copyright (C) 2012 Igalia, S.L.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "GLContextEGL.h"
+
+#if USE(EGL)
+
+#include "GraphicsContext3D.h"
+#include <wtf/OwnPtr.h>
+
+#if USE(OPENGL_ES_2)
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#else
+#include "OpenGLShims.h"
+#endif
+
+namespace WebCore {
+
+static EGLDisplay gSharedEGLDisplay = EGL_NO_DISPLAY;
+
+#if USE(OPENGL_ES_2)
+static const EGLenum gGLAPI = EGL_OPENGL_ES_API;
+#else
+static const EGLenum gGLAPI = EGL_OPENGL_API;
+#endif
+
+static EGLDisplay sharedEGLDisplay()
+{
+    static bool initialized = false;
+    if (!initialized) {
+        initialized = true;
+#if PLATFORM(X11)
+        gSharedEGLDisplay = eglGetDisplay(GLContext::sharedX11Display());
+#else
+        gSharedEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+#endif
+        if (gSharedEGLDisplay != EGL_NO_DISPLAY && (!eglInitialize(gSharedEGLDisplay, 0, 0) || !eglBindAPI(gGLAPI)))
+            gSharedEGLDisplay = EGL_NO_DISPLAY;
+    }
+    return gSharedEGLDisplay;
+}
+
+static const EGLint gContextAttributes[] = {
+#if USE(OPENGL_ES_2)
+    EGL_CONTEXT_CLIENT_VERSION, 2,
+#endif
+    EGL_NONE
+};
+
+static bool getEGLConfig(EGLConfig* config, GLContextEGL::EGLSurfaceType surfaceType)
+{
+    EGLint attributeList[] = {
+#if USE(OPENGL_ES_2)
+        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+#else
+        EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
+#endif
+        EGL_RED_SIZE, 8,
+        EGL_GREEN_SIZE, 8,
+        EGL_BLUE_SIZE, 8,
+        EGL_STENCIL_SIZE, 8,
+        EGL_ALPHA_SIZE, 8,
+        EGL_SURFACE_TYPE, EGL_NONE,
+        EGL_NONE
+    };
+
+    switch (surfaceType) {
+    case GLContextEGL::PbufferSurface:
+        attributeList[13] = EGL_PBUFFER_BIT;
+        break;
+    case GLContextEGL::PixmapSurface:
+        attributeList[13] = EGL_PIXMAP_BIT;
+        break;
+    case GLContextEGL::WindowSurface:
+        attributeList[13] = EGL_WINDOW_BIT;
+        break;
+    }
+
+    EGLint numberConfigsReturned;
+    return eglChooseConfig(sharedEGLDisplay(), attributeList, config, 1, &numberConfigsReturned) && numberConfigsReturned;
+}
+
+PassOwnPtr<GLContextEGL> GLContextEGL::createWindowContext(EGLNativeWindowType window, GLContext* sharingContext)
+{
+    EGLContext eglSharingContext = sharingContext ? static_cast<GLContextEGL*>(sharingContext)->m_context : 0;
+
+    EGLDisplay display = sharedEGLDisplay();
+    if (display == EGL_NO_DISPLAY)
+        return nullptr;
+
+    EGLConfig config;
+    if (!getEGLConfig(&config, WindowSurface))
+        return nullptr;
+
+    EGLContext context = eglCreateContext(display, config, eglSharingContext, gContextAttributes);
+    if (context == EGL_NO_CONTEXT)
+        return nullptr;
+
+    EGLSurface surface = eglCreateWindowSurface(display, config, window, 0);
+    if (surface == EGL_NO_SURFACE)
+        return nullptr;
+
+    return adoptPtr(new GLContextEGL(context, surface, WindowSurface));
+}
+
+PassOwnPtr<GLContextEGL> GLContextEGL::createPbufferContext(EGLContext sharingContext)
+{
+    EGLDisplay display = sharedEGLDisplay();
+    if (display == EGL_NO_DISPLAY)
+        return nullptr;
+
+    EGLConfig config;
+    if (!getEGLConfig(&config, PbufferSurface))
+        return nullptr;
+
+    EGLContext context = eglCreateContext(display, config, sharingContext, gContextAttributes);
+    if (context == EGL_NO_CONTEXT)
+        return nullptr;
+
+    static const int pbufferAttributes[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE };
+    EGLSurface surface = eglCreatePbufferSurface(display, config, pbufferAttributes);
+    if (surface == EGL_NO_SURFACE) {
+        eglDestroyContext(display, context);
+        return nullptr;
+    }
+
+    return adoptPtr(new GLContextEGL(context, surface, PbufferSurface));
+}
+
+PassOwnPtr<GLContextEGL> GLContextEGL::createPixmapContext(EGLContext sharingContext)
+{
+#if PLATFORM(X11)
+    EGLDisplay display = sharedEGLDisplay();
+    if (display == EGL_NO_DISPLAY)
+        return nullptr;
+
+    EGLConfig config;
+    if (!getEGLConfig(&config, PixmapSurface))
+        return nullptr;
+
+    EGLContext context = eglCreateContext(display, config, sharingContext, gContextAttributes);
+    if (context == EGL_NO_CONTEXT)
+        return nullptr;
+
+    EGLint depth;
+    if (!eglGetConfigAttrib(display, config, EGL_DEPTH_SIZE, &depth))
+        return nullptr;
+
+    Pixmap pixmap = XCreatePixmap(sharedX11Display(), DefaultRootWindow(sharedX11Display()), 1, 1, depth);
+    if (!pixmap)
+        return nullptr;
+
+    EGLSurface surface = eglCreatePixmapSurface(display, config, pixmap, 0);
+#else
+    EGLSurface surface = EGL_NO_SURFACE;
+#endif
+    if (surface == EGL_NO_SURFACE)
+        return nullptr;
+
+    return adoptPtr(new GLContextEGL(context, surface, PixmapSurface));
+}
+
+PassOwnPtr<GLContextEGL> GLContextEGL::createContext(EGLNativeWindowType window, GLContext* sharingContext)
+{
+    if (!sharedEGLDisplay())
+        return nullptr;
+
+    static bool initialized = false;
+    static bool success = true;
+    if (!initialized) {
+#if !USE(OPENGL_ES_2)
+        success = initializeOpenGLShims();
+#endif
+        initialized = true;
+    }
+    if (!success)
+        return nullptr;
+
+    EGLContext eglSharingContext = sharingContext ? static_cast<GLContextEGL*>(sharingContext)->m_context : 0;
+    OwnPtr<GLContextEGL> context = window ? createWindowContext(window, sharingContext) : nullptr;
+    if (!context)
+        context = createPixmapContext(eglSharingContext);
+
+    if (!context)
+        context = createPbufferContext(eglSharingContext);
+    
+    return context.release();
+}
+
+GLContextEGL::GLContextEGL(EGLContext context, EGLSurface surface, EGLSurfaceType type)
+    : m_context(context)
+    , m_surface(surface)
+    , m_type(type)
+{
+}
+
+GLContextEGL::~GLContextEGL()
+{
+    EGLDisplay display = sharedEGLDisplay();
+    if (m_context) {
+        glBindFramebuffer(GL_FRAMEBUFFER, 0);
+        eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+        eglDestroyContext(display, m_context);
+    }
+
+    if (m_surface)
+        eglDestroySurface(display, m_surface);
+}
+
+bool GLContextEGL::canRenderToDefaultFramebuffer()
+{
+    return m_type == WindowSurface;
+}
+
+IntSize GLContextEGL::defaultFrameBufferSize()
+{
+    if (!canRenderToDefaultFramebuffer())
+        return IntSize();
+
+    EGLint width, height;
+    if (!eglQuerySurface(sharedEGLDisplay(), m_surface, EGL_WIDTH, &width)
+        || !eglQuerySurface(sharedEGLDisplay(), m_surface, EGL_HEIGHT, &height))
+        return IntSize();
+
+    return IntSize(width, height);
+}
+
+bool GLContextEGL::makeContextCurrent()
+{
+    ASSERT(m_context && m_surface);
+
+    GLContext::makeContextCurrent();
+    if (eglGetCurrentContext() == m_context)
+        return true;
+
+    return eglMakeCurrent(sharedEGLDisplay(), m_surface, m_surface, m_context);
+}
+
+void GLContextEGL::swapBuffers()
+{
+    ASSERT(m_surface);
+    eglSwapBuffers(sharedEGLDisplay(), m_surface);
+}
+
+void GLContextEGL::waitNative()
+{
+    eglWaitNative(EGL_CORE_NATIVE_ENGINE);
+}
+
+#if ENABLE(WEBGL)
+PlatformGraphicsContext3D GLContextEGL::platformContext()
+{
+    return m_context;
+}
+#endif
+
+} // namespace WebCore
+
+#endif // USE(EGL)
diff --git a/Source/WebCore/platform/graphics/egl/GLContextEGL.h b/Source/WebCore/platform/graphics/egl/GLContextEGL.h
new file mode 100644 (file)
index 0000000..c5d4bf7
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301 USA
+ */
+
+#ifndef GLContextEGL_h
+#define GLContextEGL_h
+
+#if USE(EGL)
+
+#include "GLContext.h"
+
+#include <EGL/egl.h>
+
+namespace WebCore {
+
+class GLContextEGL : public GLContext {
+    WTF_MAKE_NONCOPYABLE(GLContextEGL);
+public:
+    enum EGLSurfaceType { PbufferSurface, WindowSurface, PixmapSurface };
+    static PassOwnPtr<GLContextEGL> createContext(EGLNativeWindowType, GLContext* sharingContext = 0);
+    static PassOwnPtr<GLContextEGL> createWindowContext(EGLNativeWindowType, GLContext* sharingContext);
+
+    virtual ~GLContextEGL();
+    virtual bool makeContextCurrent();
+    virtual void swapBuffers();
+    virtual void waitNative();
+    virtual bool canRenderToDefaultFramebuffer();
+    virtual IntSize defaultFrameBufferSize();
+
+
+#if ENABLE(WEBGL)
+    virtual PlatformGraphicsContext3D platformContext();
+#endif
+
+private:
+    static PassOwnPtr<GLContextEGL> createPbufferContext(EGLContext sharingContext);
+    static PassOwnPtr<GLContextEGL> createPixmapContext(EGLContext sharingContext);
+
+    static void addActiveContext(GLContextEGL*);
+    static void cleanupSharedEGLDisplay(void);
+
+    GLContextEGL(EGLContext, EGLSurface, EGLSurfaceType);
+
+    EGLContext m_context;
+    EGLSurface m_surface;
+    EGLSurfaceType m_type;
+};
+
+} // namespace WebCore
+
+#endif // USE(EGL)
+
+#endif // GLContextEGL_h
index 9540b86..31f32cf 100644 (file)
 
 namespace WebCore {
 
-// We do not want to call glXMakeContextCurrent using different Display pointers,
-// because it might lead to crashes in some drivers (fglrx). We use a shared display
-// pointer here.
-static Display* gSharedDisplay = 0;
-Display* GLContextGLX::sharedDisplay()
-{
-    if (!gSharedDisplay)
-        gSharedDisplay = XOpenDisplay(0);
-    return gSharedDisplay;
-}
-
-// Because of driver bugs, exiting the program when there are active pbuffers
-// can crash the X server (this has been observed with the official Nvidia drivers).
-// We need to ensure that we clean everything up on exit. There are several reasons
-// that GraphicsContext3Ds will still be alive at exit, including user error (memory
-// leaks) and the page cache. In any case, we don't want the X server to crash.
-typedef Vector<GLContext*> ActiveContextList;
-static ActiveContextList& activeContextList()
-{
-    DEFINE_STATIC_LOCAL(ActiveContextList, activeContexts, ());
-    return activeContexts;
-}
-
-void GLContextGLX::addActiveContext(GLContextGLX* context)
-{
-    static bool addedAtExitHandler = false;
-    if (!addedAtExitHandler) {
-        atexit(&GLContextGLX::cleanupActiveContextsAtExit);
-        addedAtExitHandler = true;
-    }
-    activeContextList().append(context);
-}
-
-static bool gCleaningUpAtExit = false;
-
-void GLContextGLX::removeActiveContext(GLContext* context)
-{
-    // If we are cleaning up the context list at exit, don't bother removing the context
-    // from the list, since we don't want to modify the list while it's being iterated.
-    if (gCleaningUpAtExit)
-        return;
-
-    ActiveContextList& contextList = activeContextList();
-    size_t i = contextList.find(context);
-    if (i != notFound)
-        contextList.remove(i);
-}
-
-void GLContextGLX::cleanupActiveContextsAtExit()
-{
-    gCleaningUpAtExit = true;
-
-    ActiveContextList& contextList = activeContextList();
-    for (size_t i = 0; i < contextList.size(); ++i)
-        delete contextList[i];
-
-    if (!gSharedDisplay)
-        return;
-    XCloseDisplay(gSharedDisplay);
-    gSharedDisplay = 0;
-}
-
 PassOwnPtr<GLContextGLX> GLContextGLX::createWindowContext(XID window, GLContext* sharingContext)
 {
-    Display* display = sharedDisplay();
+    Display* display = sharedX11Display();
     XWindowAttributes attributes;
     if (!XGetWindowAttributes(display, window, &attributes))
         return nullptr;
@@ -130,7 +68,7 @@ PassOwnPtr<GLContextGLX> GLContextGLX::createPbufferContext(GLXContext sharingCo
     };
 
     int returnedElements;
-    Display* display = sharedDisplay();
+    Display* display = sharedX11Display();
     GLXFBConfig* configs = glXChooseFBConfig(display, 0, fbConfigAttributes, &returnedElements);
     if (!returnedElements) {
         XFree(configs);
@@ -170,7 +108,7 @@ PassOwnPtr<GLContextGLX> GLContextGLX::createPixmapContext(GLXContext sharingCon
         0
     };
 
-    Display* display = sharedDisplay();
+    Display* display = sharedX11Display();
     XVisualInfo* visualInfo = glXChooseVisual(display, DefaultScreen(display), visualAttributes);
     if (!visualInfo)
         return nullptr;
@@ -200,7 +138,7 @@ PassOwnPtr<GLContextGLX> GLContextGLX::createPixmapContext(GLXContext sharingCon
 
 PassOwnPtr<GLContextGLX> GLContextGLX::createContext(XID window, GLContext* sharingContext)
 {
-    if (!sharedDisplay())
+    if (!sharedX11Display())
         return nullptr;
 
     static bool initialized = false;
@@ -231,7 +169,6 @@ GLContextGLX::GLContextGLX(GLXContext context)
     , m_pixmap(0)
     , m_glxPixmap(0)
 {
-    addActiveContext(this);
 }
 
 GLContextGLX::GLContextGLX(GLXContext context, Pixmap pixmap, GLXPixmap glxPixmap)
@@ -241,7 +178,6 @@ GLContextGLX::GLContextGLX(GLXContext context, Pixmap pixmap, GLXPixmap glxPixma
     , m_pixmap(pixmap)
     , m_glxPixmap(glxPixmap)
 {
-    addActiveContext(this);
 }
 
 GLContextGLX::~GLContextGLX()
@@ -250,23 +186,22 @@ GLContextGLX::~GLContextGLX()
         // This may be necessary to prevent crashes with NVidia's closed source drivers. Originally
         // from Mozilla's 3D canvas implementation at: http://bitbucket.org/ilmari/canvas3d/
         glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-        glXMakeCurrent(sharedDisplay(), None, None);
-        glXDestroyContext(sharedDisplay(), m_context);
+        glXMakeCurrent(sharedX11Display(), None, None);
+        glXDestroyContext(sharedX11Display(), m_context);
     }
 
     if (m_pbuffer) {
-        glXDestroyPbuffer(sharedDisplay(), m_pbuffer);
+        glXDestroyPbuffer(sharedX11Display(), m_pbuffer);
         m_pbuffer = 0;
     }
     if (m_glxPixmap) {
-        glXDestroyGLXPixmap(sharedDisplay(), m_glxPixmap);
+        glXDestroyGLXPixmap(sharedX11Display(), m_glxPixmap);
         m_glxPixmap = 0;
     }
     if (m_pixmap) {
-        XFreePixmap(sharedDisplay(), m_pixmap);
+        XFreePixmap(sharedX11Display(), m_pixmap);
         m_pixmap = 0;
     }
-    removeActiveContext(this);
 }
 
 bool GLContextGLX::canRenderToDefaultFramebuffer()
@@ -282,7 +217,7 @@ IntSize GLContextGLX::defaultFrameBufferSize()
     int x, y;
     Window rootWindow;
     unsigned int width, height, borderWidth, depth;
-    if (!XGetGeometry(sharedDisplay(), m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth))
+    if (!XGetGeometry(sharedX11Display(), m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth))
         return IntSize();
 
     return IntSize(width, height);
@@ -297,18 +232,23 @@ bool GLContextGLX::makeContextCurrent()
         return true;
 
     if (m_window)
-        return glXMakeCurrent(sharedDisplay(), m_window, m_context);
+        return glXMakeCurrent(sharedX11Display(), m_window, m_context);
 
     if (m_pbuffer)
-        return glXMakeCurrent(sharedDisplay(), m_pbuffer, m_context);
+        return glXMakeCurrent(sharedX11Display(), m_pbuffer, m_context);
 
-    return ::glXMakeCurrent(sharedDisplay(), m_glxPixmap, m_context);
+    return ::glXMakeCurrent(sharedX11Display(), m_glxPixmap, m_context);
 }
 
 void GLContextGLX::swapBuffers()
 {
     if (m_window)
-        glXSwapBuffers(sharedDisplay(), m_window);
+        glXSwapBuffers(sharedX11Display(), m_window);
+}
+
+void GLContextGLX::waitNative()
+{
+    glXWaitX();
 }
 
 #if USE(3D_GRAPHICS)
index b3b18c1..00f56e7 100644 (file)
@@ -25,7 +25,6 @@
 #include "GLContext.h"
 
 typedef struct __GLXcontextRec* GLXContext;
-typedef struct _XDisplay Display;
 typedef struct __GLXcontextRec *GLXContext;
 typedef unsigned long GLXPbuffer;
 typedef unsigned long GLXPixmap;
@@ -45,11 +44,10 @@ public:
     virtual ~GLContextGLX();
     virtual bool makeContextCurrent();
     virtual void swapBuffers();
+    virtual void waitNative();
     virtual bool canRenderToDefaultFramebuffer();
     virtual IntSize defaultFrameBufferSize();
 
-    static Display* sharedDisplay();
-
 #if USE(3D_GRAPHICS)
     virtual PlatformGraphicsContext3D platformContext();
 #endif
@@ -57,10 +55,6 @@ public:
 private:
     static PassOwnPtr<GLContextGLX> createPbufferContext(GLXContext sharingContext);
     static PassOwnPtr<GLContextGLX> createPixmapContext(GLXContext sharingContext);
-    static void removeActiveContext(GLContext*);
-
-    static void addActiveContext(GLContextGLX*);
-    static void cleanupActiveContextsAtExit();
 
     GLContextGLX(GLXContext);
     GLContextGLX(GLXContext, Pixmap, GLXPixmap);
index 68f4f24..8253877 100644 (file)
@@ -277,12 +277,6 @@ void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>
 {
 }
 
-void GraphicsContext3D::releaseShaderCompiler()
-{
-    makeContextCurrent();
-    notImplemented();
-}
-
 }
 
 #endif // USE(3D_GRAPHICS)
index 54af7ca..d7c05e6 100644 (file)
 
 namespace WebCore {
 
+void GraphicsContext3D::releaseShaderCompiler()
+{
+    makeContextCurrent();
+    notImplemented();
+}
+
 void GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary(int x, int y, int width, int height, unsigned char* pixels)
 {
     ::glReadPixels(x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
index dc8624d..991571d 100644 (file)
@@ -39,7 +39,6 @@
 #include "LayerWebKitThread.h"
 #endif
 #include "NotImplemented.h"
-#include "OpenGLESShims.h"
 
 namespace WebCore {
 
@@ -66,14 +65,14 @@ void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsi
 #else
     if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
          resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
-        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        ::glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
         ::glFlush();
     }
 
     ::glReadPixels(x, y, width, height, format, type, data);
 
     if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
-        ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
+        ::glBindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
 #endif
 }
 
@@ -122,12 +121,12 @@ bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
     bool mustRestoreFBO = false;
     if (m_boundFBO != m_fbo) {
         mustRestoreFBO = true;
-        ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+        ::glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
     }
 
     ::glBindTexture(GL_TEXTURE_2D, m_texture);
     ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, pixelDataType, 0);
-    ::glFramebufferTexture2DEXT(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0);
+    ::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0);
 
     ::glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
     ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
@@ -139,28 +138,28 @@ bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
     if (m_attrs.stencil || m_attrs.depth) {
         // Use a 24 bit depth buffer where we know we have it.
         if (supportPackedDepthStencilBuffer) {
-            ::glBindTexture(GL_TEXTURE_2D, m_depthStencilBuffer);
-            ::glTexImage2D(GL_TEXTURE_2D, 0, GraphicsContext3D::DEPTH_STENCIL, width, height, 0, GraphicsContext3D::DEPTH_STENCIL, GraphicsContext3D::UNSIGNED_INT_24_8, 0);
+            ::glBindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer);
+            ::glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height);
             if (m_attrs.stencil)
-                ::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_depthStencilBuffer, 0);
+                ::glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer);
             if (m_attrs.depth)
-                ::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_depthStencilBuffer, 0);
-            ::glBindTexture(GL_TEXTURE_2D, 0);
+                ::glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer);
+            ::glBindRenderbuffer(GL_RENDERBUFFER, 0);
         } else {
             if (m_attrs.stencil) {
-                ::glBindRenderbufferEXT(GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);
-                ::glRenderbufferStorageEXT(GraphicsContext3D::RENDERBUFFER, GL_STENCIL_INDEX8, width, height);
-                ::glFramebufferRenderbufferEXT(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);
+                ::glBindRenderbuffer(GL_RENDERBUFFER, m_stencilBuffer);
+                ::glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, width, height);
+                ::glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_stencilBuffer);
             }
             if (m_attrs.depth) {
-                ::glBindRenderbufferEXT(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
-                ::glRenderbufferStorageEXT(GraphicsContext3D::RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
-                ::glFramebufferRenderbufferEXT(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
+                ::glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer);
+                ::glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
+                ::glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthBuffer);
             }
-            ::glBindRenderbufferEXT(GraphicsContext3D::RENDERBUFFER, 0);
+            ::glBindRenderbuffer(GL_RENDERBUFFER, 0);
         }
     }
-    if (glCheckFramebufferStatusEXT(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
+    if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
         // FIXME: cleanup
         notImplemented();
     }
@@ -178,7 +177,7 @@ void GraphicsContext3D::resolveMultisamplingIfNecessary(const IntRect& rect)
 void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
 {
     makeContextCurrent();
-    ::glRenderbufferStorageEXT(target, internalformat, width, height);
+    ::glRenderbufferStorage(target, internalformat, width, height);
 }
 
 void GraphicsContext3D::getIntegerv(GC3Denum pname, GC3Dint* value)
index 1678c49..cbd5192 100644 (file)
@@ -100,13 +100,6 @@ bool GraphicsContext3D::isGLES2Compliant() const
 #endif
 }
 
-#if !USE(OPENGL_ES_2)
-void GraphicsContext3D::releaseShaderCompiler()
-{
-    notImplemented();
-}
-#endif
-
 GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
     : m_context(context)
     , m_hostWindow(hostWindow)
index 17d5934..a90dbe4 100644 (file)
@@ -28,6 +28,9 @@
     #define TEXMAP_OPENGL_ES_2
 #endif
 #endif
+#if PLATFORM(GTK) && USE(OPENGL_ES_2)
+#define TEXMAP_OPENGL_ES_2
+#endif
 
 #include "FilterOperations.h"
 #include "GraphicsContext.h"
index 5e69b44..92539a2 100644 (file)
@@ -27,9 +27,7 @@
 #include "config.h"
 #include "RedirectedXCompositeWindow.h"
 
-#if USE(GLX)
-#include "GLContextGLX.h"
-#include <GL/glx.h>
+#if PLATFORM(X11)
 #include <X11/extensions/Xcomposite.h>
 #include <X11/extensions/Xdamage.h>
 #include <cairo-xlib.h>
@@ -105,13 +103,12 @@ RedirectedXCompositeWindow::RedirectedXCompositeWindow(const IntSize& size)
     , m_parentWindow(0)
     , m_pixmap(0)
     , m_surface(0)
-    , m_pendingResizeSourceId(0)
     , m_needsNewPixmapAfterResize(false)
     , m_damage(0)
     , m_damageNotifyCallback(0)
     , m_damageNotifyData(0)
 {
-    Display* display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
+    Display* display = GLContext::sharedX11Display();
 
     // This is based on code from Chromium: src/content/common/gpu/image_transport_surface_linux.cc
     XSetWindowAttributes windowAttributes;
@@ -165,7 +162,7 @@ RedirectedXCompositeWindow::~RedirectedXCompositeWindow()
     if (getWindowHashMap().isEmpty())
         gdk_window_remove_filter(0, reinterpret_cast<GdkFilterFunc>(filterXDamageEvent), 0);
 
-    Display* display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
+    Display* display = GLContext::sharedX11Display();
     XDamageDestroy(display, m_damage);
     XDestroyWindow(display, m_window);
     XDestroyWindow(display, m_parentWindow);
@@ -174,11 +171,11 @@ RedirectedXCompositeWindow::~RedirectedXCompositeWindow()
 
 void RedirectedXCompositeWindow::resize(const IntSize& size)
 {
-    Display* display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
+    Display* display = GLContext::sharedX11Display();
     XResizeWindow(display, m_window, size.width(), size.height());
 
     XFlush(display);
-    glXWaitX();
+    context()->waitNative();
 
     // This swap is based on code in Chromium. It tries to work-around a bug in the Intel drivers
     // where a swap is necessary to ensure the front and back buffers are properly resized.
@@ -263,4 +260,4 @@ void RedirectedXCompositeWindow::callDamageNotifyCallback()
 
 } // namespace WebCore
 
-#endif // USE(GLX)
+#endif // PLATFORM(X11)
index 865be3b..7a98c37 100644 (file)
@@ -27,9 +27,9 @@
 #ifndef  RedirectedXCompositeWindow_h
 #define  RedirectedXCompositeWindow_h
 
-#if USE(GLX)
+#if PLATFORM(X11)
 
-#include "GLContextGLX.h"
+#include "GLContext.h"
 #include "IntSize.h"
 #include "RefPtrCairo.h"
 
@@ -78,6 +78,6 @@ private:
 
 } // namespace WebCore
 
-#endif // USE(GLX)
+#endif // PLATFORM(X11)
 
 #endif // RedirectedXCompositeWindow_h
index 9b5cf1f..6d09c63 100644 (file)
@@ -1,3 +1,20 @@
+2012-10-05  José Dapena Paz  <jdapena@igalia.com>
+
+        [GTK] Add support for creating EGL contexts
+        https://bugs.webkit.org/show_bug.cgi?id=77921
+
+        Reviewed by Martin Robinson.
+
+        This patch adds support for EGL, using OpenGL and OpenGL ES 2. Both
+        options are set up on compile time, with the configure options
+        --enable-egl and --enable-gles2.
+
+        The implementation only adds support for EGL on top of X11, to
+        isolate the changes to the minimum. More changes should come
+        later to enable EGL for other targets (as Wayland).
+
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
+
 2012-10-04  Jon Lee  <jonlee@apple.com>
 
         Add a setting to enable plugin snapshotting
index 77a1b16..af2ae89 100644 (file)
@@ -36,7 +36,7 @@
 #include <GL/gl.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
-#include <WebCore/GLContextGLX.h>
+#include <WebCore/GLContext.h>
 #include <WebCore/Page.h>
 #include <WebCore/Settings.h>
 
index c8f110d..bcc0a8e 100644 (file)
@@ -547,11 +547,84 @@ AC_ARG_ENABLE(unstable_features,
               [],[enable_unstable_features="no"])
 AC_MSG_RESULT([$enable_unstable_features])
 
-found_opengl="no"
-if test "$with_target" = "x11"; then
+found_opengl=no
+AC_ARG_ENABLE(glx,
+              AC_HELP_STRING([--enable-glx], [enable support for GLX [default=auto]]),
+              [], [enable_glx="auto"])
+AC_ARG_ENABLE(egl,
+              AC_HELP_STRING([--enable-egl], [enable support for EGL [default=auto]]),
+              [], [enable_egl="auto"])
+AC_ARG_ENABLE(gles2,
+              AC_HELP_STRING([--enable-gles2], [enable support for OpenGL ES 2 [default=auto]]),
+              [], [enable_gles2="auto"])
+
+have_glx=no
+AC_CHECK_HEADERS([GL/glx.h], [have_glx="yes"], [have_glx="no"])
+AC_MSG_CHECKING([whether to enable GLX support])
+if test "$enable_glx" != "no"; then
+   if test "$have_glx" = "no"; then
+      if test "$enable_glx" = "yes"; then
+         AC_MSG_ERROR([--enable-glx specified, but not available])
+      else
+         enable_glx=no
+      fi
+   elif test "$enable_gles2" != "yes"; then
+      enable_glx=yes
+   fi
+fi
+AC_MSG_RESULT([$enable_glx])
+
+have_egl=no
+AC_CHECK_HEADERS([EGL/egl.h], [have_egl="yes"], [have_egl="no"])
+AC_MSG_CHECKING([whether to enable EGL support])
+if test "$enable_egl" != "no"; then
+   if test "$have_egl" = "no"; then
+      if test "$enable_egl" = "yes"; then
+         AC_MSG_ERROR([--enable-egl specified, but not available])
+      else
+         enable_egl=no
+      fi
+   else
+      enable_egl=yes
+   fi
+fi
+AC_MSG_RESULT([$enable_egl])
+
+have_gles2=no
+AC_CHECK_HEADERS([GLES2/gl2.h], [have_gles2="yes"], [have_gles2="no"])
+AC_MSG_CHECKING([whether to use OpenGL ES 2 support])
+if test "$enable_glx" = "yes"; then
+   if test "$enable_gles2" = "yes"; then
+      AC_MSG_ERROR([Cannot enable OpenGL ES 2 support with GLX])
+   else
+      enable_gles2=no
+   fi
+fi
+if test "$enable_egl" = "no"; then
+   if test "$enable_gles2" = "yes"; then
+      AC_MSG_ERROR([Cannot enable OpenGL ES 2 support without EGL])
+   else
+      enable_gles2=no
+   fi
+fi
+if test "$enable_gles2" != "no"; then
+   if test "$have_gles2" = "no"; then
+      if test "$enable_gles2" = "yes"; then
+         AC_MSG_ERROR([--enable-gles2 specified, but not available])
+      else
+         enable_gles2=no
+      fi
+   else
+      enable_gles2=yes
+      found_opengl=yes
+   fi
+fi
+AC_MSG_RESULT([$enable_gles2])
+
+if test "$enable_gles2" != "yes"; then
     AC_CHECK_HEADERS([GL/gl.h], [found_opengl="yes"], [])
-    AC_CHECK_HEADERS([GL/glx.h], [], [found_opengl="no"])
 fi
+
 AC_MSG_CHECKING([which GPU acceleration backend to use])
 AC_ARG_WITH(acceleration_backend,
             AC_HELP_STRING([--with-acceleration-backend=@<:@opengl/clutter/none@:>@],
@@ -926,7 +999,7 @@ if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
    AC_SUBST([GSTREAMER_LIBS])
 fi
 
-
+acceleration_backend_description=$with_acceleration_backend
 if test "$with_acceleration_backend" = "clutter"; then
    PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= $CLUTTER_REQUIRED_VERSION)
    PKG_CHECK_MODULES([CLUTTER_GTK],
@@ -939,7 +1012,22 @@ if test "$with_acceleration_backend" = "clutter"; then
 fi
 
 if test "$with_acceleration_backend" = "opengl"; then
-    OPENGL_LIBS="-lGL -ldl"
+   if test "$enable_gles2" = "yes"; then
+    acceleration_backend_description+= "(gles2"
+    OPENGL_LIBS="-lGLESv2"
+   else
+    acceleration_backend_description+="(gl"
+    OPENGL_LIBS="-lGL"
+   fi
+   if test "$enable_egl" = "yes"; then
+    acceleration_backend_description+=", egl"
+    OPENGL_LIBS+=" -lEGL"
+   fi
+   if test "$enable_glx" = "yes"; then
+    acceleration_backend_description+=", glx"
+   fi
+   OPENGL_LIBS+=" -ldl"
+   acceleration_backend_description+=")"
 fi
 AC_SUBST([OPENGL_LIBS])
 
@@ -1048,8 +1136,10 @@ AM_CONDITIONAL([USE_TEXTURE_MAPPER_GL], [test "$enable_accelerated_compositing"
 AM_CONDITIONAL([USE_CLUTTER], [test "$with_acceleration_backend" = "clutter"])
 
 # These are the same now, but they will soon be separate.
-AM_CONDITIONAL([USE_GLX], [test "$with_acceleration_backend" = "opengl"])
 AM_CONDITIONAL([USE_OPENGL], [test "$with_acceleration_backend" = "opengl"])
+AM_CONDITIONAL([USE_EGL], [test "$enable_egl" = "yes"])
+AM_CONDITIONAL([USE_GLES2], [test "$enable_gles2" = "yes"])
+AM_CONDITIONAL([USE_GLX], [test "$enable_glx" = "yes"])
 
 # IndexedDB implies LevelDB, but other features may one day require LevelDB.
 AM_CONDITIONAL([ENABLE_INDEXED_DATABASE],[test "$enable_indexed_database" = "yes"])
@@ -1128,7 +1218,7 @@ Build configuration:
  Unicode backend                                          : $with_unicode_backend
  Font backend                                             : $with_font_backend
  Optimized memory allocator                               : $enable_fast_malloc
- Accelerated rendering backend                            : $with_acceleration_backend
+ Accelerated rendering backend                            : $acceleration_backend_description
 
 Features:
 =======