Backed out changeset 460bb9bef9c3 (bug 1561883) for build bustage at nsWaylandDisplay.h on a CLOSED TREE.

This commit is contained in:
Gurzau Raul 2019-06-29 14:24:34 +03:00
Родитель b0fcd74087
Коммит 125bf10273
5 изменённых файлов: 14 добавлений и 18 удалений

Просмотреть файл

@ -36,7 +36,6 @@
# ifdef MOZ_WAYLAND
# include <gdk/gdkwayland.h>
# include <dlfcn.h>
# include "mozilla/widget/nsWaylandDisplay.h"
# endif // MOZ_WIDGET_GTK
#endif // MOZ_WAYLAND
@ -788,7 +787,10 @@ EGLDisplay GLLibraryEGL::CreateDisplay(bool forceAccel,
// Some drivers doesn't support EGL_DEFAULT_DISPLAY
GdkDisplay* gdkDisplay = gdk_display_get_default();
if (!GDK_IS_X11_DISPLAY(gdkDisplay)) {
nativeDisplay = WaylandDisplayGetWLDisplay(gdkDisplay);
static auto sGdkWaylandDisplayGetWlDisplay =
(wl_display * (*)(GdkDisplay*))
dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
nativeDisplay = sGdkWaylandDisplayGetWlDisplay(gdkDisplay);
if (!nativeDisplay) {
NS_WARNING("Failed to get wl_display.");
return nullptr;

Просмотреть файл

@ -377,7 +377,7 @@ void WindowBackBuffer::Attach(wl_surface* aSurface) {
wl_surface_attach(aSurface, GetWlBuffer(), 0, 0);
wl_surface_commit(aSurface);
wl_display_flush(WaylandDisplayGetWLDisplay());
wl_display_flush(GetWaylandDisplay()->GetDisplay());
SetAttached();
}

Просмотреть файл

@ -35,7 +35,6 @@
#ifdef MOZ_WAYLAND
# include <sys/mman.h>
# include "nsWaylandDisplay.h"
#endif
namespace mozilla {
@ -759,7 +758,11 @@ static const struct wl_registry_listener keyboard_registry_listener = {
gdk_registry_handle_global, gdk_registry_handle_global_remove};
void KeymapWrapper::InitBySystemSettingsWayland() {
wl_display* display = WaylandDisplayGetWLDisplay();
// Available as of GTK 3.8+
static auto sGdkWaylandDisplayGetWlDisplay = (wl_display * (*)(GdkDisplay*))
dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
wl_display* display =
sGdkWaylandDisplayGetWlDisplay(gdk_display_get_default());
wl_registry_add_listener(wl_display_get_registry(display),
&keyboard_registry_listener, this);
}

Просмотреть файл

@ -16,17 +16,6 @@ namespace widget {
bool nsWaylandDisplay::mIsDMABufEnabled;
bool nsWaylandDisplay::mIsDMABufPrefLoaded;
wl_display* WaylandDisplayGetWLDisplay(GdkDisplay* aGdkDisplay) {
if (!aGdkDisplay) {
aGdkDisplay = gdk_display_get_default();
}
// Available as of GTK 3.8+
static auto sGdkWaylandDisplayGetWlDisplay = (wl_display * (*)(GdkDisplay*))
dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
return sGdkWaylandDisplayGetWlDisplay(aGdkDisplay);
}
// nsWaylandDisplay needs to be created for each calling thread(main thread,
// compositor thread and render thread)
#define MAX_DISPLAY_CONNECTIONS 3
@ -74,7 +63,10 @@ void WaylandDispatchDisplays() {
// Get WaylandDisplay for given wl_display and actual calling thread.
static nsWaylandDisplay* WaylandDisplayGetLocked(GdkDisplay* aGdkDisplay,
const StaticMutexAutoLock&) {
wl_display* waylandDisplay = WaylandDisplayGetWLDisplay(aGdkDisplay);
// Available as of GTK 3.8+
static auto sGdkWaylandDisplayGetWlDisplay = (wl_display * (*)(GdkDisplay*))
dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display");
wl_display* waylandDisplay = sGdkWaylandDisplayGetWlDisplay(aGdkDisplay);
// Search existing display connections for wl_display:thread combination.
for (auto& display : gWaylandDisplays) {

Просмотреть файл

@ -101,7 +101,6 @@ class nsWaylandDisplay {
void WaylandDispatchDisplays();
void WaylandDisplayShutdown();
nsWaylandDisplay* WaylandDisplayGet(GdkDisplay* aGdkDisplay = nullptr);
wl_display* WaylandDisplayGetWLDisplay(GdkDisplay* aGdkDisplay = nullptr);
typedef struct gbm_device* (*CreateDeviceFunc)(int);
typedef struct gbm_bo* (*CreateFunc)(struct gbm_device*, uint32_t, uint32_t,