repo/testing/firefox/patches/fix-wayland-only.patch
2022-06-30 01:34:09 -05:00

102 lines
3.3 KiB
Diff

diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
index 2bf6de6..d2fce1f 100644
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -79,6 +79,7 @@
# if defined(MOZ_WAYLAND)
# include <gdk/gdkwayland.h>
# include <wayland-egl.h>
+# include "mozilla/WidgetUtilsGtk.h"
# include "mozilla/widget/nsWaylandDisplay.h"
# endif
#endif
diff --git a/gfx/gl/GLContextProviderLinux.cpp b/gfx/gl/GLContextProviderLinux.cpp
index f8f6f3d..7205449 100644
--- a/gfx/gl/GLContextProviderLinux.cpp
+++ b/gfx/gl/GLContextProviderLinux.cpp
@@ -13,7 +13,9 @@ namespace mozilla::gl {
using namespace mozilla::gfx;
using namespace mozilla::widget;
+#ifdef MOZ_X11
static class GLContextProviderGLX sGLContextProviderGLX;
+#endif
static class GLContextProviderEGL sGLContextProviderEGL;
already_AddRefed<GLContext> GLContextProviderLinux::CreateForCompositorWidget(
@@ -22,9 +24,11 @@ already_AddRefed<GLContext> GLContextProviderLinux::CreateForCompositorWidget(
if (gfxVars::UseEGL()) {
return sGLContextProviderEGL.CreateForCompositorWidget(
aCompositorWidget, aHardwareWebRender, aForceAccelerated);
+#ifdef MOZ_X11
} else {
return sGLContextProviderGLX.CreateForCompositorWidget(
aCompositorWidget, aHardwareWebRender, aForceAccelerated);
+#endif
}
}
@@ -33,8 +37,10 @@ already_AddRefed<GLContext> GLContextProviderLinux::CreateHeadless(
const GLContextCreateDesc& desc, nsACString* const out_failureId) {
if (gfxVars::UseEGL()) {
return sGLContextProviderEGL.CreateHeadless(desc, out_failureId);
+#ifdef MOZ_X11
} else {
return sGLContextProviderGLX.CreateHeadless(desc, out_failureId);
+#endif
}
}
@@ -42,8 +48,10 @@ already_AddRefed<GLContext> GLContextProviderLinux::CreateHeadless(
GLContext* GLContextProviderLinux::GetGlobalContext() {
if (gfxVars::UseEGL()) {
return sGLContextProviderEGL.GetGlobalContext();
+#ifdef MOZ_X11
} else {
return sGLContextProviderGLX.GetGlobalContext();
+#endif
}
}
@@ -51,8 +59,10 @@ GLContext* GLContextProviderLinux::GetGlobalContext() {
void GLContextProviderLinux::Shutdown() {
if (gfxVars::UseEGL()) {
sGLContextProviderEGL.Shutdown();
+#ifdef MOZ_X11
} else {
sGLContextProviderGLX.Shutdown();
+#endif
}
}
diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
index bc492a8..fc0a005 100644
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -108,10 +108,11 @@ elif gl_provider == "Linux":
# GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
# as it includes X11 headers which cause conflicts.
SOURCES += [
- "GLContextProviderGLX.cpp",
"GLContextProviderLinux.cpp",
]
EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
+ if CONFIG["MOZ_X11"]:
+ SOURCES += ["GLContextProviderGLX.cpp"]
if CONFIG["MOZ_WAYLAND"]:
SOURCES += ["SharedSurfaceDMABUF.cpp"]
diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
index dd8dab6..34494ad 100644
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -998,7 +998,7 @@ gfxPlatformGtk::CreateGlobalHardwareVsyncSource() {
RefPtr<VsyncSource> softwareVsync = new XrandrSoftwareVsyncSource();
return softwareVsync.forget();
#else
- return CreateSoftwareVsyncSource();
+ return GetSoftwareVsyncSource();
#endif
}