mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1597861 - Pause compositor during hiding Wayland window r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D53906 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d67d8f7e90
commit
c9b4baab9c
@ -2632,13 +2632,12 @@ void WebRenderBridgeParent::FlushRendering(bool aWaitForPresent) {
|
||||
|
||||
void WebRenderBridgeParent::Pause() {
|
||||
MOZ_ASSERT(IsRootWebRenderBridgeParent());
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
|
||||
if (!IsRootWebRenderBridgeParent() || mDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
mApis[wr::RenderRoot::Default]->Pause();
|
||||
#endif
|
||||
mPaused = true;
|
||||
}
|
||||
|
||||
|
@ -100,8 +100,8 @@ void RenderCompositorEGL::Pause() {
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
java::GeckoSurfaceTexture::DestroyUnused((int64_t)gl());
|
||||
java::GeckoSurfaceTexture::DetachAllFromGLContext((int64_t)gl());
|
||||
DestroyEGLSurface();
|
||||
#endif
|
||||
DestroyEGLSurface();
|
||||
}
|
||||
|
||||
bool RenderCompositorEGL::Resume() {
|
||||
|
@ -4430,9 +4430,21 @@ void nsWindow::HideWaylandWindow() {
|
||||
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,
|
||||
// destroy the compositor & recreate a new compositor on next
|
||||
// expose event.
|
||||
DestroyLayerManager();
|
||||
// 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
|
||||
gtk_widget_hide(mShell);
|
||||
@ -7333,8 +7345,8 @@ void nsWindow::GetCompositorWidgetInitData(
|
||||
#ifdef MOZ_WAYLAND
|
||||
wl_surface* nsWindow::GetWaylandSurface() {
|
||||
if (mContainer) {
|
||||
struct wl_surface* surface = moz_container_get_wl_surface(
|
||||
MOZ_CONTAINER(mContainer));
|
||||
struct wl_surface* surface =
|
||||
moz_container_get_wl_surface(MOZ_CONTAINER(mContainer));
|
||||
if (surface != NULL) {
|
||||
wl_surface_set_buffer_scale(surface, GdkScaleFactor());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user