Title: [275025] releases/WebKitGTK/webkit-2.32/Source
Revision
275025
Author
[email protected]
Date
2021-03-25 07:07:01 -0700 (Thu, 25 Mar 2021)

Log Message

Merge r274869 - [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: releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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-12  Michael Catanzaro  <[email protected]>
 
         REGRESSION(r274270): [WPE][GTK] Broke Epiphany test /embed/ephy-web-view/error-pages-not-stored-in-history

Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/GLContext.h (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/GLContext.h	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/GLContext.h	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/GraphicsContext.h (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/GraphicsContext.h	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/GraphicsContext.h	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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: releases/WebKitGTK/webkit-2.32/Source/WebKit/ChangeLog (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebKit/ChangeLog	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebKit/ChangeLog	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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-16  Khem Raj  <[email protected]>
 
         [CMake] Build fails on RISC-V with GCC 11

Modified: releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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: releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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: releases/WebKitGTK/webkit-2.32/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (275024 => 275025)


--- releases/WebKitGTK/webkit-2.32/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp	2021-03-25 14:06:53 UTC (rev 275024)
+++ releases/WebKitGTK/webkit-2.32/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp	2021-03-25 14:07:01 UTC (rev 275025)
@@ -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();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to