Files
macports-ports/www/webkit2-gtk/files/patch-egl-display-no-crash.diff
T
2026-07-07 17:26:02 -07:00

62 lines
2.8 KiB
Diff

--- Source/WebCore/platform/graphics/egl/PlatformDisplayDefault.cpp.orig
+++ Source/WebCore/platform/graphics/egl/PlatformDisplayDefault.cpp
@@ -37,8 +37,7 @@ std::unique_ptr<PlatformDisplayDefault> PlatformDisplayDefault::create()
{
auto glDisplay = GLDisplay::create(eglGetDisplay(EGL_DEFAULT_DISPLAY));
if (!glDisplay) {
- WTFLogAlways("Could not create default EGL display: %s. Aborting...", GLContext::lastErrorString());
- CRASH();
+ return nullptr;
}
return std::unique_ptr<PlatformDisplayDefault>(new PlatformDisplayDefault(WTFMove(glDisplay)));
--- Source/WebCore/platform/graphics/egl/PlatformDisplaySurfaceless.cpp.orig
+++ Source/WebCore/platform/graphics/egl/PlatformDisplaySurfaceless.cpp
@@ -44,8 +44,7 @@ std::unique_ptr<PlatformDisplaySurfaceless> PlatformDisplaySurfaceless::create()
glDisplay = GLDisplay::create(eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, nullptr));
if (!glDisplay) {
- WTFLogAlways("Could not create surfaceless EGL display: %s. Aborting...", GLContext::lastErrorString());
- CRASH();
+ return nullptr;
}
return std::unique_ptr<PlatformDisplaySurfaceless>(new PlatformDisplaySurfaceless(WTFMove(glDisplay)));
--- Source/WebKit/WebProcess/glib/WebProcessGLib.cpp.orig
+++ Source/WebKit/WebProcess/glib/WebProcessGLib.cpp
@@ -169,8 +169,7 @@ void WebProcess::initializePlatformDisplayIfNeeded() const
}
#endif
- WTFLogAlways("Could not create EGL display: no supported platform available. Aborting...");
- CRASH();
+ return;
}
void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
--- Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp.orig
+++ Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
@@ -44,6 +44,7 @@
#include <WebCore/Page.h>
#include <WebCore/PageOverlayController.h>
#include <WebCore/Region.h>
+#include <WebCore/PlatformDisplay.h>
#include <WebCore/Settings.h>
#include <WebCore/ShareableBitmap.h>
#include <wtf/SetForScope.h>
@@ -204,8 +205,13 @@ void DrawingAreaCoordinatedGraphics::updatePreferences(const WebPreferencesStore&
{
Settings& settings = m_webPage->corePage()->settings();
#if PLATFORM(GTK)
- if (settings.acceleratedCompositingEnabled())
+ if (settings.acceleratedCompositingEnabled()) {
WebProcess::singleton().initializePlatformDisplayIfNeeded();
+ if (!PlatformDisplay::sharedDisplayIfExists()) {
+ settings.setAcceleratedCompositingEnabled(false);
+ settings.setForceCompositingMode(false);
+ }
+ }
#endif
settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
// Fixed position elements need to be composited and create stacking contexts