diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index a654c8e8486d..6dcb56067ca3 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -1265,6 +1265,9 @@ class LayerViewSupport final void SyncPauseCompositor() { MOZ_ASSERT(AndroidBridge::IsJavaUiThread()); + // Set this true prior to attempting to pause the compositor, so that if + // pausing fails the subsequent recovery knows to initialize the compositor + // in a paused state. mCompositorPaused = true; if (mUiCompositorControllerChild) { @@ -1299,8 +1302,12 @@ class LayerViewSupport final void SyncResumeCompositor() { MOZ_ASSERT(AndroidBridge::IsJavaUiThread()); + // Set this false prior to attempting to resume the compositor, so that if + // resumption fails the subsequent recovery knows to initialize the + // compositor in a resumed state. + mCompositorPaused = false; + if (mUiCompositorControllerChild) { - mCompositorPaused = false; bool resumed = mUiCompositorControllerChild->Resume(); if (!resumed) { gfxCriticalNote @@ -1316,6 +1323,11 @@ class LayerViewSupport final jni::Object::Param aSurfaceControl) { MOZ_ASSERT(AndroidBridge::IsJavaUiThread()); + // Set this false prior to attempting to resume the compositor, so that if + // resumption fails the subsequent recovery knows to initialize the + // compositor in a resumed state. + mCompositorPaused = false; + mX = aX; mY = aY; mWidth = aWidth; @@ -1362,8 +1374,6 @@ class LayerViewSupport final mRequestedNewSurface = false; - mCompositorPaused = false; - class OnResumedEvent : public nsAppShell::Event { GeckoSession::Compositor::GlobalRef mCompositor;