Bug 1684194 [Linux] Use RenderCompositorEGL on X11/EGL, r=sotaro

Differential Revision: https://phabricator.services.mozilla.com/D108508
This commit is contained in:
stransky 2021-03-18 13:46:03 +00:00
Родитель 8b8afdb266
Коммит 97fe4dc9a5
4 изменённых файлов: 11 добавлений и 3 удалений

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

@ -255,7 +255,7 @@ already_AddRefed<GLContext> GLContextEGLFactory::CreateImpl(
int visualID = 0;
#ifdef MOZ_X11
GdkDisplay* gdkDisplay = gdk_display_get_default();
if (GdkIsX11Display(gdkDisplay)) {
if (GdkIsX11Display(gdkDisplay) && aWindow) {
auto* display = GDK_DISPLAY_XDISPLAY(gdkDisplay);
if (display) {
XWindowAttributes windowAttrs;

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

@ -36,7 +36,7 @@ namespace mozilla::wr {
UniquePtr<RenderCompositor> RenderCompositorEGL::Create(
RefPtr<widget::CompositorWidget> aWidget, nsACString& aError) {
#ifdef MOZ_WAYLAND
if (!mozilla::widget::GdkIsWaylandDisplay()) {
if (!gfx::gfxVars::UseEGL()) {
return nullptr;
}
#endif

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

@ -1125,7 +1125,7 @@ static already_AddRefed<gl::GLContext> CreateGLContext(nsACString& aError) {
#elif defined(MOZ_WIDGET_ANDROID)
gl = CreateGLContextEGL();
#elif defined(MOZ_WAYLAND)
if (mozilla::widget::GdkIsWaylandDisplay()) {
if (gfx::gfxVars::UseEGL()) {
gl = CreateGLContextEGL();
}
#elif XP_MACOSX

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

@ -4861,6 +4861,14 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
// the drawing window
mGdkWindow = gtk_widget_get_window(eventWidget);
#ifdef MOZ_WAYLAND
if (mIsX11Display && gfx::gfxVars::UseEGL() && isAccelerated) {
mCompositorInitiallyPaused = true;
mNeedsCompositorResume = true;
MaybeResumeCompositor();
}
#endif
if (mWindowType == eWindowType_popup) {
// gdk does not automatically set the cursor for "temporary"
// windows, which are what gtk uses for popups.