Diff
Modified: trunk/ChangeLog (219390 => 219391)
--- trunk/ChangeLog 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/ChangeLog 2017-07-12 13:58:46 UTC (rev 219391)
@@ -1,3 +1,14 @@
+2017-07-12 Zan Dobersek <[email protected]>
+
+ [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.
+
2017-07-11 Carlos Garcia Campos <[email protected]>
[GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
Modified: trunk/Source/WebCore/CMakeLists.txt (219390 => 219391)
--- trunk/Source/WebCore/CMakeLists.txt 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-07-12 13:58:46 UTC (rev 219391)
@@ -3325,7 +3325,7 @@
# For platforms that want to use system-provided OpenGL (ES) / EGL headers,
# these include directories, libraries or definitions need to be
# added before the ANGLE directories.
- if (USE_OPENGL)
+ if (USE_OPENGL AND NOT USE_LIBEPOXY)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
${OPENGL_INCLUDE_DIRS}
)
@@ -3333,7 +3333,7 @@
${OPENGL_LIBRARIES}
)
add_definitions(${OPENGL_DEFINITIONS})
- elseif (USE_OPENGL_ES_2)
+ elseif (USE_OPENGL_ES_2 AND NOT USE_LIBEPOXY)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
${OPENGLES2_INCLUDE_DIRS}
)
@@ -3343,7 +3343,7 @@
add_definitions(${OPENGLES2_DEFINITIONS})
endif ()
- if (USE_EGL)
+ if (USE_EGL AND NOT USE_LIBEPOXY)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
${EGL_INCLUDE_DIRS}
)
@@ -3353,6 +3353,15 @@
add_definitions(${EGL_DEFINITIONS})
endif ()
+ if (USE_LIBEPOXY)
+ list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
+ ${LIBEPOXY_INCLUDE_DIRS}
+ )
+ list(APPEND WebCore_LIBRARIES
+ ${LIBEPOXY_LIBRARIES}
+ )
+ endif ()
+
list(APPEND WebCore_INCLUDE_DIRECTORIES
"${ANGLE_FORWARDING_HEADERS_DIR}"
"${WEBCORE_DIR}/platform/graphics/gpu"
Modified: trunk/Source/WebCore/ChangeLog (219390 => 219391)
--- trunk/Source/WebCore/ChangeLog 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/ChangeLog 2017-07-12 13:58:46 UTC (rev 219391)
@@ -1,3 +1,55 @@
+2017-07-12 Zan Dobersek <[email protected]>
+
+ [WPE] Use libepoxy
+ https://bugs.webkit.org/show_bug.cgi?id=172104
+
+ Reviewed by Michael Catanzaro.
+
+ 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:
+
2017-07-12 Carlos Garcia Campos <[email protected]>
ImageDecoder: Gifs with infinite animation only play once very often
Modified: trunk/Source/WebCore/PlatformWPE.cmake (219390 => 219391)
--- trunk/Source/WebCore/PlatformWPE.cmake 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/PlatformWPE.cmake 2017-07-12 13:58:46 UTC (rev 219391)
@@ -161,7 +161,6 @@
list(APPEND WebCore_LIBRARIES
${CAIRO_LIBRARIES}
- ${EGL_LIBRARIES}
${GLIB_GIO_LIBRARIES}
${GLIB_GMODULE_LIBRARIES}
${GLIB_GOBJECT_LIBRARIES}
@@ -179,7 +178,6 @@
list(APPEND WebCore_INCLUDE_DIRECTORIES
${CAIRO_INCLUDE_DIRS}
- ${EGL_INCLUDE_DIRS}
${GIO_UNIX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${GNUTLS_INCLUDE_DIRS}
Modified: trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h 2017-07-12 13:58:46 UTC (rev 219391)
@@ -26,6 +26,12 @@
#ifndef ANGLEWebKitBridge_h
#define ANGLEWebKitBridge_h
+#if USE(LIBEPOXY)
+// libepoxy headers have to be included before <ANGLE/ShaderLang.h> in order to avoid
+// picking up khrplatform.h inclusion that's done in ANGLE.
+#include <epoxy/gl.h>
+#endif
+
#include <ANGLE/ShaderLang.h>
#include <wtf/text/WTFString.h>
@@ -36,7 +42,9 @@
#elif PLATFORM(WIN)
#include "OpenGLESShims.h"
#elif PLATFORM(GTK) || PLATFORM(WPE)
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+// <epoxy/gl.h> already included above.
+#elif USE(OPENGL_ES_2)
#include <GLES2/gl2.h>
#else
#include "OpenGLShims.h"
Added: trunk/Source/WebCore/platform/graphics/EpoxyShims.h (0 => 219391)
--- trunk/Source/WebCore/platform/graphics/EpoxyShims.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/EpoxyShims.h 2017-07-12 13:58:46 UTC (rev 219391)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <epoxy/gl.h>
+
+// Undefine the OpenGL EXT entrypoints and instead define them to the non-extension
+// variants. This mirrors OpenGLESShims.h, but the un-definition has to be done first
+// due to epoxy headers already being included.
+
+// Unlike OpenGLESShims.h, we don't define specific constants since those are already
+// provided by the libepoxy headers, and their values are the same regardless of the
+// ARB, EXT or OES suffix.
+
+#undef glBindFramebufferEXT
+#define glBindFramebufferEXT glBindFramebuffer
+
+#undef glFramebufferTexture2DEXT
+#define glFramebufferTexture2DEXT glFramebufferTexture2D
+
+#undef glBindRenderbufferEXT
+#define glBindRenderbufferEXT glBindRenderbuffer
+
+#undef glRenderbufferStorageEXT
+#define glRenderbufferStorageEXT glRenderbufferStorage
+
+#undef glFramebufferRenderbufferEXT
+#define glFramebufferRenderbufferEXT glFramebufferRenderbuffer
+
+#undef glCheckFramebufferStatusEXT
+#define glCheckFramebufferStatusEXT glCheckFramebufferStatus
+
+#undef glDeleteFramebuffersEXT
+#define glDeleteFramebuffersEXT glDeleteFramebuffers
+
+#undef glDeleteRenderbuffersEXT
+#define glDeleteRenderbuffersEXT glDeleteRenderbuffers
+
+#undef glGenRenderbuffersEXT
+#define glGenRenderbuffersEXT glGenRenderbuffers
+
+#undef glGenFramebuffersEXT
+#define glGenFramebuffersEXT glGenFramebuffers
+
+#undef glGetFramebufferAttachmentParameterivEXT
+#define glGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
+
+#undef glGetRenderbufferParameterivEXT
+#define glGetRenderbufferParameterivEXT glGetRenderbufferParameteriv
+
+#undef glIsRenderbufferEXT
+#define glIsRenderbufferEXT glIsRenderbuffer
+
+#undef glIsFramebufferEXT
+#define glIsFramebufferEXT glIsFramebuffer
+
+#undef glGenerateMipmapEXT
+#define glGenerateMipmapEXT glGenerateMipmap
Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/GLContext.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -26,7 +26,9 @@
#include "GLContextEGL.h"
#endif
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#elif USE(OPENGL_ES_2)
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
#include <GLES3/gl3.h>
@@ -62,7 +64,7 @@
static bool initializeOpenGLShimsIfNeeded()
{
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES_2) || USE(LIBEPOXY)
return true;
#else
static bool initialized = false;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -26,7 +26,9 @@
#include <wtf/StdLibExtras.h>
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#elif USE(OPENGL_ES_2)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#else
Modified: trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -59,7 +59,11 @@
#endif
#if USE(EGL)
+#if USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#else
#include <EGL/egl.h>
+#endif
#include <wtf/HashSet.h>
#include <wtf/NeverDestroyed.h>
#endif
Modified: trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -43,6 +43,9 @@
#include <wtf/Vector.h>
#if ENABLE(ACCELERATED_2D_CANVAS)
+#if USE(EGL) && USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#endif
#include <cairo-gl.h>
#endif
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -47,11 +47,16 @@
#include <ANGLE/ShaderLang.h>
#endif
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#elif USE(OPENGL)
+#include "OpenGLShims.h"
+#endif
+
#if USE(OPENGL_ES_2)
#include "Extensions3DOpenGLES.h"
#else
#include "Extensions3DOpenGL.h"
-#include "OpenGLShims.h"
#endif
#if USE(TEXTURE_MAPPER)
@@ -69,7 +74,7 @@
static bool initialized = false;
static bool success = true;
if (!initialized) {
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES_2) && !USE(LIBEPOXY)
success = initializeOpenGLShims();
#endif
initialized = true;
Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -50,6 +50,10 @@
#if ENABLE(ACCELERATED_2D_CANVAS)
#include "GLContext.h"
#include "TextureMapperGL.h"
+
+#if USE(EGL) && USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#endif
#include <cairo-gl.h>
#if USE(OPENGL_ES_2)
Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -23,13 +23,20 @@
#include "GraphicsContext3D.h"
#include "PlatformDisplay.h"
+
+#if USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#else
#include <EGL/egl.h>
+#endif
#if USE(CAIRO)
#include <cairo.h>
#endif
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#elif USE(OPENGL_ES2)
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -25,7 +25,11 @@
// FIXME: For now default to the GBM EGL platform, but this should really be
// somehow deducible from the build configuration.
#define __GBM__ 1
+#if USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#else
#include <EGL/egl.h>
+#endif
#include <wpe/renderer-backend-egl.h>
namespace WebCore {
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -59,6 +59,12 @@
#endif
#include <gst/app/gstappsink.h>
+
+#if USE(LIBEPOXY)
+// Include the <epoxy/gl.h> header before <gst/gl/gl.h>.
+#include <epoxy/gl.h>
+#endif
+
#define GST_USE_UNSTABLE_API
#include <gst/gl/gl.h>
#undef GST_USE_UNSTABLE_API
@@ -70,9 +76,7 @@
#endif
#if USE(EGL)
-#if !PLATFORM(WPE)
#include "GLContextEGL.h"
-#endif
#include <gst/gl/egl/gstgldisplay_egl.h>
#endif
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -36,7 +36,9 @@
#include <OpenGLES/ES2/glext.h>
#include <OpenGLES/ES3/gl.h>
#else
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include "EpoxyShims.h"
+#elif USE(OPENGL_ES_2)
#include "OpenGLESShims.h"
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -33,7 +33,12 @@
#if ENABLE(GRAPHICS_CONTEXT_3D)
#include "GraphicsContext3D.h"
#include "NotImplemented.h"
+
+#if USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#else
#include <EGL/egl.h>
+#endif
namespace WebCore {
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h 2017-07-12 13:58:46 UTC (rev 219391)
@@ -30,9 +30,13 @@
#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#else
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#endif
#ifndef GL_EXT_robustness
/* reuse GL_NO_ERROR */
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -64,7 +64,9 @@
#define GL_RGBA32F_ARB 0x8814
#define GL_RGB32F_ARB 0x8815
#else
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include "EpoxyShims.h"
+#elif USE(OPENGL_ES_2)
#include "OpenGLESShims.h"
#elif PLATFORM(MAC)
#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
Modified: trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -29,7 +29,9 @@
#if ENABLE(GRAPHICS_CONTEXT_3D)
#include "TemporaryOpenGLSetting.h"
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include "EpoxyShims.h"
+#elif USE(OPENGL_ES_2)
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
#include "OpenGLESShims.h"
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -22,7 +22,9 @@
#if ENABLE(GRAPHICS_CONTEXT_3D) && USE(TEXTURE_MAPPER)
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#elif USE(OPENGL_ES_2)
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
Modified: trunk/Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp (219390 => 219391)
--- trunk/Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -32,7 +32,11 @@
// FIXME: For now default to the GBM EGL platform, but this should really be
// somehow deducible from the build configuration.
#define __GBM__ 1
+#if USE(LIBEPOXY)
+#include <epoxy/egl.h>
+#else
#include <EGL/egl.h>
+#endif
#include <wpe/renderer-backend-egl.h>
namespace WebCore {
Modified: trunk/Source/WebKit2/ChangeLog (219390 => 219391)
--- trunk/Source/WebKit2/ChangeLog 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebKit2/ChangeLog 2017-07-12 13:58:46 UTC (rev 219391)
@@ -1,3 +1,14 @@
+2017-07-12 Zan Dobersek <[email protected]>
+
+ [WPE] Use libepoxy
+ https://bugs.webkit.org/show_bug.cgi?id=172104
+
+ Reviewed by Michael Catanzaro.
+
+ * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags.
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+ Include <epoxy/gl.h> when compiling with libepoxy usage enabled.
+
2017-07-12 Carlos Garcia Campos <[email protected]>
Web Automation: upstream safaridriver's _javascript_ atom implementations
Modified: trunk/Source/WebKit2/PlatformWPE.cmake (219390 => 219391)
--- trunk/Source/WebKit2/PlatformWPE.cmake 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebKit2/PlatformWPE.cmake 2017-07-12 13:58:46 UTC (rev 219391)
@@ -413,7 +413,6 @@
"${WTF_DIR}/wtf/gobject"
"${WTF_DIR}"
${CAIRO_INCLUDE_DIRS}
- ${EGL_INCLUDE_DIRS}
${FREETYPE2_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${GSTREAMER_INCLUDE_DIRS}
Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (219390 => 219391)
--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2017-07-12 13:58:46 UTC (rev 219391)
@@ -34,7 +34,9 @@
#include <WebCore/TransformationMatrix.h>
#include <wtf/SetForScope.h>
-#if USE(OPENGL_ES_2)
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#elif USE(OPENGL_ES_2)
#include <GLES2/gl2.h>
#else
#include <GL/gl.h>
Added: trunk/Source/cmake/FindLibEpoxy.cmake (0 => 219391)
--- trunk/Source/cmake/FindLibEpoxy.cmake (rev 0)
+++ trunk/Source/cmake/FindLibEpoxy.cmake 2017-07-12 13:58:46 UTC (rev 219391)
@@ -0,0 +1,46 @@
+# - Try to find libepoxy.
+# Once done, this will define
+#
+# LIBEPOXY_INCLUDE_DIRS - the libtasn1 include directories
+# LIBEPOXY_LIBRARIES - the libtasn1 libraries.
+#
+# Copyright (C) 2017 Igalia S.L.
+#
+# 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.
+
+find_package(PkgConfig)
+pkg_check_modules(PC_LIBEPOXY QUIET epoxy)
+
+find_path(LIBEPOXY_INCLUDE_DIRS
+ NAMES epoxy/gl.h
+ PATHS ${PC_LIBEPOXY_INCLUDEDIR} ${PC_LIBEPOXY_INCLUDE_DIRS}
+)
+
+find_library(LIBEPOXY_LIBRARIES
+ NAMES epoxy
+ PATHS ${PC_LIBEPOXY_LIBDIR} ${PC_LIBEPOXY_LIBRARY_DIRS}
+)
+
+mark_as_advanced(LIBEPOXY_INCLUDE_DIRS LIBEPOXY_LIBRARIES)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBEPOXY REQUIRED_VARS LIBEPOXY_INCLUDE_DIRS LIBEPOXY_LIBRARIES)
Modified: trunk/Source/cmake/OptionsWPE.cmake (219390 => 219391)
--- trunk/Source/cmake/OptionsWPE.cmake 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Source/cmake/OptionsWPE.cmake 2017-07-12 13:58:46 UTC (rev 219391)
@@ -75,6 +75,7 @@
find_package(Freetype2 2.4.2 REQUIRED)
find_package(HarfBuzz 0.9.18 REQUIRED)
find_package(JPEG REQUIRED)
+find_package(LibEpoxy REQUIRED)
find_package(LibGcrypt 1.6.0 REQUIRED)
find_package(LibSoup 2.42.0 REQUIRED)
find_package(LibXml2 2.8.0 REQUIRED)
@@ -83,9 +84,6 @@
find_package(Sqlite REQUIRED)
find_package(WebP REQUIRED)
-find_package(OpenGLES2 REQUIRED)
-find_package(EGL REQUIRED)
-
find_package(WPEBackend REQUIRED)
set(USE_CAIRO ON)
@@ -137,6 +135,7 @@
set(USE_UDIS86 1)
+SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES_2 TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_EGL TRUE)
Modified: trunk/Tools/ChangeLog (219390 => 219391)
--- trunk/Tools/ChangeLog 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Tools/ChangeLog 2017-07-12 13:58:46 UTC (rev 219391)
@@ -1,5 +1,15 @@
2017-07-12 Zan Dobersek <[email protected]>
+ [WPE] Use libepoxy
+ https://bugs.webkit.org/show_bug.cgi?id=172104
+
+ Reviewed by Michael Catanzaro.
+
+ * WebKitTestRunner/wpe/HeadlessViewBackend.h:
+ Include the <epoxy/egl.h> header, dropping the EGL and GLES2 inclusions.
+
+2017-07-12 Zan Dobersek <[email protected]>
+
[GTK][WPE] Align Jhbuild patches for GStreamer packages
https://bugs.webkit.org/show_bug.cgi?id=174363
Modified: trunk/Tools/WebKitTestRunner/wpe/HeadlessViewBackend.h (219390 => 219391)
--- trunk/Tools/WebKitTestRunner/wpe/HeadlessViewBackend.h 2017-07-12 11:26:11 UTC (rev 219390)
+++ trunk/Tools/WebKitTestRunner/wpe/HeadlessViewBackend.h 2017-07-12 13:58:46 UTC (rev 219391)
@@ -25,11 +25,10 @@
#pragma once
+// This include order is necessary to enforce the GBM EGL platform.
#include <gbm.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
+#include <epoxy/egl.h>
+
#include <cairo.h>
#include <glib.h>
#include <unordered_map>