[WPE] Use libepoxy
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 13:58:46 +0000 (13:58 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 13:58:46 +0000 (13:58 +0000)
commit8709fdb4bc92dbd9e2d97bb43601ae565be0d55a
treeaec927afa2a85b4185eefdea6bdde6871fcf565c
parent0be28d8b732e646ad82958587d24c4d104657d8c
[WPE] Use libepoxy
https://bugs.webkit.org/show_bug.cgi?id=172104

Reviewed by Michael Catanzaro.

.:

* Source/cmake/FindLibEpoxy.cmake: Added.
* Source/cmake/OptionsWPE.cmake: Find libepoxy, don't search for
EGL or OpenGL ES anymore, and enable USE_LIBEPOXY by default.

Source/WebCore:

No new tests -- no changes in behavior.

Implement the proper libepoxy header inclusion for ports that enable it.

The library acts as a loading facility working on top of the system-provided
OpenGL and EGL libraries, with the headers providing a complete collection of
specification-defined OpenGL and EGL types, constants and entrypoints.

Support is added through the USE(LIBEPOXY) build guard. Note that this guard
isn't exclusive with USE(OPENGL), USE(OPENGL_ES_2) or USE(EGL), so the
USE(LIBEPOXY) condition is tested before those.

In case of OpenGL headers, the <epoxy/gl.h> header is included, and in
case of EGL headers, the <epoxy/egl.h> header. <epoxy/egl.h> includes
<epoxy/gl.h> on its own, so in some cases the inclusion of the latter is
omitted.

EpoxyShims.h header is added, doing a job similar to OpenGLESShims.h. The
EXT-suffixed GL entrypoints are redefined to the non-suffixed versions.
No suffixed constants are defined because those are defined by the libepoxy
headers to the well-known values.

* CMakeLists.txt:
* PlatformWPE.cmake:
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/EpoxyShims.h: Added.
* platform/graphics/GLContext.cpp:
(WebCore::initializeOpenGLShimsIfNeeded):
* platform/graphics/GraphicsContext3DPrivate.cpp:
* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/cairo/CairoUtilities.cpp:
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::create):
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/egl/GLContextEGL.cpp:
* platform/graphics/egl/GLContextEGLWPE.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:

Source/WebKit2:

* PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
Include <epoxy/gl.h> when compiling with libepoxy usage enabled.

Tools:

* WebKitTestRunner/wpe/HeadlessViewBackend.h:
Include the <epoxy/egl.h> header, dropping the EGL and GLES2 inclusions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformWPE.cmake
Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
Source/WebCore/platform/graphics/EpoxyShims.h [new file with mode: 0644]
Source/WebCore/platform/graphics/GLContext.cpp
Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/PlatformDisplay.cpp
Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp
Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformWPE.cmake
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
Source/cmake/FindLibEpoxy.cmake [new file with mode: 0644]
Source/cmake/OptionsWPE.cmake
Tools/ChangeLog
Tools/WebKitTestRunner/wpe/HeadlessViewBackend.h