Backed out 2 changesets (bug 1663003) for bustages on nsWindow.cpp . CLOSED TREE

Backed out changeset 50a87c4ddf15 (bug 1663003)
Backed out changeset c3035ba4d8fc (bug 1663003)
This commit is contained in:
Narcis Beleuzu 2020-09-10 23:40:09 +03:00
Родитель aff2c781e1
Коммит 69a21ed2df
2 изменённых файлов: 4 добавлений и 21 удалений

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

@ -65,7 +65,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/gfx/BuildConstants.h"
#include "mozilla/layers/CompositorOptions.h"
#include "mozilla/widget/CompositorWidget.h"
#include "nsDebug.h"
@ -904,8 +903,6 @@ bool CreateConfig(EglDisplay& egl, EGLConfig* aConfig, int32_t depth,
return false;
}
Maybe<EGLConfig> fallbackConfig;
for (int j = 0; j < ncfg; ++j) {
EGLConfig config = configs[j];
EGLint r, g, b, a;
@ -923,29 +920,19 @@ bool CreateConfig(EglDisplay& egl, EGLConfig* aConfig, int32_t depth,
continue;
}
}
if (kIsX11 && aVisual) {
#if defined(MOZ_X11)
if (aVisual) {
int vis;
if (!egl.fGetConfigAttrib(config, LOCAL_EGL_NATIVE_VISUAL_ID, &vis) ||
aVisual != vis) {
if (!fallbackConfig) {
fallbackConfig = Some(config);
}
continue;
}
}
#endif
*aConfig = config;
return true;
}
}
// We don't have a frame buffer X11 visual which matches the EGL visual
// from GLContextEGL::FindVisual(). Let's try to use the fallback one and hope
// we're not on NVIDIA (Bug 1478454) as it causes X11 BadMatch error there.
if (kIsX11 && fallbackConfig) {
*aConfig = fallbackConfig.value();
return true;
}
return false;
}

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

@ -4346,11 +4346,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
int visualId = 0;
bool haveVisual;
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1663003
// We need to use GLX to get visual even on EGL until
// EGL can provide compositable visual:
// https://gitlab.freedesktop.org/mesa/mesa/-/issues/149
if (true /* !gfx::gfxVars::UseEGL() */) {
if (!gfx::gfxVars::UseEGL()) {
auto display = GDK_DISPLAY_XDISPLAY(gtk_widget_get_display(mShell));
int screenNumber = GDK_SCREEN_XNUMBER(screen);
haveVisual = GLContextGLX::FindVisual(