Title: [292104] trunk/Source/WebCore
- Revision
- 292104
- Author
- [email protected]
- Date
- 2022-03-30 05:58:38 -0700 (Wed, 30 Mar 2022)
Log Message
Slim down ANGLEHeaders.h
https://bugs.webkit.org/show_bug.cgi?id=238539
Patch by Zan Dobersek <[email protected]> on 2022-03-30
Reviewed by Adrian Perez de Castro.
Define the EGL_NO_PLATFORM_SPECIFIC_TYPES macro in ANGLEHeaders.h before
including the ANGLE entrypoint headers. These will subsequently include
EGL's platform headers, but the macro prevents including additional
platform-specific headers (e.g. X11 development headers) that often
bring in additional generically-named identifiers and macros that end up
colliding with WebCore and WebKit types. The libepoxy header inclusion
is also removed, it should be done where necessary and not everywhere
ANGLEHeaders.h ends up included.
* platform/graphics/angle/ANGLEHeaders.h:
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (292103 => 292104)
--- trunk/Source/WebCore/ChangeLog 2022-03-30 12:04:30 UTC (rev 292103)
+++ trunk/Source/WebCore/ChangeLog 2022-03-30 12:58:38 UTC (rev 292104)
@@ -1,3 +1,23 @@
+2022-03-30 Zan Dobersek <[email protected]>
+
+ Slim down ANGLEHeaders.h
+ https://bugs.webkit.org/show_bug.cgi?id=238539
+
+ Reviewed by Adrian Perez de Castro.
+
+ Define the EGL_NO_PLATFORM_SPECIFIC_TYPES macro in ANGLEHeaders.h before
+ including the ANGLE entrypoint headers. These will subsequently include
+ EGL's platform headers, but the macro prevents including additional
+ platform-specific headers (e.g. X11 development headers) that often
+ bring in additional generically-named identifiers and macros that end up
+ colliding with WebCore and WebKit types. The libepoxy header inclusion
+ is also removed, it should be done where necessary and not everywhere
+ ANGLEHeaders.h ends up included.
+
+ * platform/graphics/angle/ANGLEHeaders.h:
+ * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
+ * platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h:
+
2022-03-30 Lauro Moura <[email protected]>
Unreviewed, non-unified build fixes
Modified: trunk/Source/WebCore/platform/graphics/angle/ANGLEHeaders.h (292103 => 292104)
--- trunk/Source/WebCore/platform/graphics/angle/ANGLEHeaders.h 2022-03-30 12:04:30 UTC (rev 292103)
+++ trunk/Source/WebCore/platform/graphics/angle/ANGLEHeaders.h 2022-03-30 12:58:38 UTC (rev 292104)
@@ -41,10 +41,8 @@
#define GL_GLEXT_PROTOTYPES 0
#endif
-#if USE(LIBEPOXY)
-#include <epoxy/gl.h>
-typedef uint64_t EGLFrameTokenANGLE;
-#endif
+// Avoid including and platfrom-specific headers that might bring in identifiers colliding with WebKit code.
+#define EGL_NO_PLATFORM_SPECIFIC_TYPES
#include <ANGLE/entry_points_egl_autogen.h>
#include <ANGLE/entry_points_egl_ext_autogen.h>
@@ -52,42 +50,6 @@
#include <ANGLE/entry_points_gles_3_0_autogen.h>
#include <ANGLE/entry_points_gles_ext_autogen.h>
-// X11 headers define a bunch of macros with common terms, interfering with WebCore and WTF enum values.
-// As a workaround, we explicitly undef them here.
-#if defined(None)
-#undef None
-#endif
-#if defined(Above)
-#undef Above
-#endif
-#if defined(Below)
-#undef Below
-#endif
-#if defined(Success)
-#undef Success
-#endif
-#if defined(False)
-#undef False
-#endif
-#if defined(True)
-#undef True
-#endif
-#if defined(Bool)
-#undef Bool
-#endif
-#if defined(Always)
-#undef Always
-#endif
-#if defined(Status)
-#undef Status
-#endif
-#if defined(Continue)
-#undef Continue
-#endif
-#if defined(Region)
-#undef Region
-#endif
-
// Note: this file can't be compiled in the same unified source file
// as others which include the system's OpenGL headers.
Modified: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp (292103 => 292104)
--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp 2022-03-30 12:04:30 UTC (rev 292103)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp 2022-03-30 12:58:38 UTC (rev 292104)
@@ -31,7 +31,6 @@
#if USE(NICOSIA) && USE(TEXTURE_MAPPER)
-#include "ANGLEHeaders.h"
#include "GraphicsContextGLTextureMapperANGLE.h"
#include "ImageBuffer.h"
#include "Logging.h"
@@ -40,6 +39,10 @@
#include "TextureMapperPlatformLayerProxyDMABuf.h"
#include "TextureMapperPlatformLayerProxyGL.h"
+#if USE(LIBEPOXY)
+#include <epoxy/gl.h>
+#endif
+
namespace Nicosia {
using namespace WebCore;
Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h (292103 => 292104)
--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h 2022-03-30 12:04:30 UTC (rev 292103)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.h 2022-03-30 12:58:38 UTC (rev 292104)
@@ -30,7 +30,6 @@
#include "GraphicsContextGLANGLE.h"
#if USE(TEXTURE_MAPPER_DMABUF)
-#include "ANGLEHeaders.h"
#include "GBMBufferSwapchain.h"
#include <wtf/HashMap.h>
#endif
@@ -44,7 +43,7 @@
struct gbm_device;
struct gbm_bo;
-typedef void *EGLImage;
+typedef void *EGLImageKHR;
#endif
namespace WebCore {
@@ -85,7 +84,7 @@
Swapchain(GCGLDisplay);
~Swapchain();
- GCGLDisplay platformDisplay { EGL_NO_DISPLAY };
+ GCGLDisplay platformDisplay { nullptr };
RefPtr<GBMBufferSwapchain> swapchain;
RefPtr<GBMBufferSwapchain::Buffer> drawBO;
RefPtr<GBMBufferSwapchain::Buffer> displayBO;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes