- Revision
- 274869
- Author
- [email protected]
- Date
- 2021-03-23 08:17:07 -0700 (Tue, 23 Mar 2021)
Log Message
[GTK] X11 build fixes
https://bugs.webkit.org/show_bug.cgi?id=223577
Patch by Philippe Normand <[email protected]> on 2021-03-23
Reviewed by Adrian Perez de Castro.
Source/WebCore:
X11 headers define a bunch of macros with common terms, interfering with WebCore and WTF
enum values. As a workaround, we explicitly undef them.
* platform/graphics/GLContext.h:
* platform/graphics/GraphicsContext.h:
Source/WebKit:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::createGLContext): GLNativeWindowType might be a long unsigned
int, which can't be reinterpret casted to uin64_t on 32-bit platforms.
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Use
WebCore::Region to prevent clashes with X11's Region.
(WebKit::DrawingAreaCoordinatedGraphics::scroll):
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaCoordinatedGraphics::display):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (274868 => 274869)
--- trunk/Source/WebCore/ChangeLog 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebCore/ChangeLog 2021-03-23 15:17:07 UTC (rev 274869)
@@ -1,3 +1,16 @@
+2021-03-23 Philippe Normand <[email protected]>
+
+ [GTK] X11 build fixes
+ https://bugs.webkit.org/show_bug.cgi?id=223577
+
+ Reviewed by Adrian Perez de Castro.
+
+ X11 headers define a bunch of macros with common terms, interfering with WebCore and WTF
+ enum values. As a workaround, we explicitly undef them.
+
+ * platform/graphics/GLContext.h:
+ * platform/graphics/GraphicsContext.h:
+
2021-03-23 Frédéric Wang <[email protected]>
Nullptr deref in WebCore::ApplyStyleCommand::applyRelativeFontStyleChange
Modified: trunk/Source/WebCore/platform/graphics/GLContext.h (274868 => 274869)
--- trunk/Source/WebCore/platform/graphics/GLContext.h 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebCore/platform/graphics/GLContext.h 2021-03-23 15:17:07 UTC (rev 274869)
@@ -48,6 +48,42 @@
typedef void* PlatformGraphicsContextGL;
+// 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
+
namespace WebCore {
class IntSize;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (274868 => 274869)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2021-03-23 15:17:07 UTC (rev 274869)
@@ -69,11 +69,17 @@
#endif
#endif
-// X11 header defines "None" as constant in macro and breakes the PaintInvalidationReasons enum's "None".
-// As a workaround, we explicitly undef X11's None here.
+// 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(Below)
+#undef Below
+#endif
+#if defined(Success)
+#undef Success
+#endif
namespace WebCore {
Modified: trunk/Source/WebKit/ChangeLog (274868 => 274869)
--- trunk/Source/WebKit/ChangeLog 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebKit/ChangeLog 2021-03-23 15:17:07 UTC (rev 274869)
@@ -1,3 +1,19 @@
+2021-03-23 Philippe Normand <[email protected]>
+
+ [GTK] X11 build fixes
+ https://bugs.webkit.org/show_bug.cgi?id=223577
+
+ Reviewed by Adrian Perez de Castro.
+
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+ (WebKit::ThreadedCompositor::createGLContext): GLNativeWindowType might be a long unsigned
+ int, which can't be reinterpret casted to uin64_t on 32-bit platforms.
+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Use
+ WebCore::Region to prevent clashes with X11's Region.
+ (WebKit::DrawingAreaCoordinatedGraphics::scroll):
+ (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
+ (WebKit::DrawingAreaCoordinatedGraphics::display):
+
2021-03-23 Aditya Keerthi <[email protected]>
[iPadOS] Stale checked item when reopening <select>
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (274868 => 274869)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2021-03-23 15:17:07 UTC (rev 274869)
@@ -86,7 +86,13 @@
ASSERT(m_nativeSurfaceHandle);
- m_context = GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle), &PlatformDisplay::sharedDisplayForCompositing());
+#if CPU(ADDRESS64)
+ auto windowType = reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle);
+#else
+ // On 32-bit platforms GLNativeWindowType is an integer type, which cannot be casted with reinterpret_cast.
+ auto windowType = static_cast<GLNativeWindowType>(m_nativeSurfaceHandle);
+#endif
+ m_context = GLContext::createContextForWindow(windowType, &PlatformDisplay::sharedDisplayForCompositing());
if (m_context)
m_context->makeContextCurrent();
}
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (274868 => 274869)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2021-03-23 15:17:07 UTC (rev 274869)
@@ -94,7 +94,7 @@
RefPtr<CoordinatedGraphicsScene> m_scene;
std::unique_ptr<WebCore::GLContext> m_context;
- uint64_t m_nativeSurfaceHandle;
+ uintptr_t m_nativeSurfaceHandle;
WebCore::TextureMapper::PaintFlags m_paintFlags { 0 };
unsigned m_suspendedCount { 0 };
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (274868 => 274869)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2021-03-23 15:03:28 UTC (rev 274868)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2021-03-23 15:17:07 UTC (rev 274869)
@@ -39,6 +39,7 @@
#include <WebCore/GraphicsContext.h>
#include <WebCore/Page.h>
#include <WebCore/PageOverlayController.h>
+#include <WebCore/Region.h>
#include <WebCore/Settings.h>
#if USE(DIRECT2D)
@@ -150,7 +151,7 @@
}
// Get the part of the dirty region that is in the scroll rect.
- Region dirtyRegionInScrollRect = intersect(scrollRect, m_dirtyRegion);
+ WebCore::Region dirtyRegionInScrollRect = intersect(scrollRect, m_dirtyRegion);
if (!dirtyRegionInScrollRect.isEmpty()) {
// There are parts of the dirty region that are inside the scroll rect.
// We need to subtract them from the region, move them and re-add them.
@@ -157,7 +158,7 @@
m_dirtyRegion.subtract(scrollRect);
// Move the dirty parts.
- Region movedDirtyRegionInScrollRect = intersect(translate(dirtyRegionInScrollRect, scrollDelta), scrollRect);
+ WebCore::Region movedDirtyRegionInScrollRect = intersect(translate(dirtyRegionInScrollRect, scrollDelta), scrollRect);
// And add them back.
m_dirtyRegion.unite(movedDirtyRegionInScrollRect);
@@ -164,7 +165,7 @@
}
// Compute the scroll repaint region.
- Region scrollRepaintRegion = subtract(scrollRect, translate(scrollRect, scrollDelta));
+ WebCore::Region scrollRepaintRegion = subtract(scrollRect, translate(scrollRect, scrollDelta));
m_dirtyRegion.unite(scrollRepaintRegion);
scheduleDisplay();
@@ -621,7 +622,7 @@
m_layerTreeHost->setRootCompositingLayer(graphicsLayer);
// Non-composited content will now be handled exclusively by the layer tree host.
- m_dirtyRegion = Region();
+ m_dirtyRegion = WebCore::Region();
m_scrollRect = IntRect();
m_scrollOffset = IntSize();
m_displayTimer.stop();
@@ -797,7 +798,7 @@
updateInfo.scrollRect = m_scrollRect;
updateInfo.scrollOffset = m_scrollOffset;
- m_dirtyRegion = Region();
+ m_dirtyRegion = WebCore::Region();
m_scrollRect = IntRect();
m_scrollOffset = IntSize();