Bug 1603927 - Do not try to pause compositor when nsWindow is destroyed r=stransky

Differential Revision: https://phabricator.services.mozilla.com/D57197

--HG--
extra : moz-landing-system : lando
This commit is contained in:
sotaro 2019-12-16 07:31:57 +00:00
Родитель 4daf948695
Коммит f03139d167
1 изменённых файлов: 19 добавлений и 17 удалений

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

@ -4436,23 +4436,25 @@ void nsWindow::HideWaylandWindow() {
g_list_delete_link(gVisibleWaylandPopupWindows, foundWindow);
}
}
if (mContainer && moz_container_has_wl_egl_window(mContainer)) {
// Because wl_egl_window is destroyed on moz_container_unmap(),
// the current compositor cannot use it anymore. To avoid crash,
// pause the compositor and destroy EGLSurface & resume the compositor
// and re-create EGLSurface on next expose event.
MOZ_ASSERT(GetRemoteRenderer());
if (CompositorBridgeChild* remoteRenderer = GetRemoteRenderer()) {
// XXX slow sync IPC
remoteRenderer->SendPause();
// Re-request initial draw callback
RefPtr<nsWindow> self(this);
moz_container_add_initial_draw_callback(mContainer, [self]() -> void {
self->mNeedsCompositorResume = true;
self->MaybeResumeCompositor();
});
} else {
DestroyLayerManager();
if (!mIsDestroyed) {
if (mContainer && moz_container_has_wl_egl_window(mContainer)) {
// Because wl_egl_window is destroyed on moz_container_unmap(),
// the current compositor cannot use it anymore. To avoid crash,
// pause the compositor and destroy EGLSurface & resume the compositor
// and re-create EGLSurface on next expose event.
MOZ_ASSERT(GetRemoteRenderer());
if (CompositorBridgeChild* remoteRenderer = GetRemoteRenderer()) {
// XXX slow sync IPC
remoteRenderer->SendPause();
// Re-request initial draw callback
RefPtr<nsWindow> self(this);
moz_container_add_initial_draw_callback(mContainer, [self]() -> void {
self->mNeedsCompositorResume = true;
self->MaybeResumeCompositor();
});
} else {
DestroyLayerManager();
}
}
}
#endif