I discovered this while investigating bug 1772839. I commented out the `DestroyEGLContext` line [here](https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/gfx/webrender_bindings/RenderCompositorEGL.cpp#149). This means that when you switch to a new tab, pausing the old compositor does not destroy the EGL surface. Therefore when we attempt to resume the new compositor, it fails, and we end up restarting the GPU process. This could occur in the wild if we encounter a WebRender error during initialization. Because the GPU process has died while the content process is in the middle of `RecvInitRendering`, creating the WebRenderLayerManager fails, and we set mLayersConnected = Some(false)` [here](https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/dom/ipc/BrowserChild.cpp#2816). Once the GPU process has been restarted, we call `ReinitRendering`. However, due to [this line](https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/dom/ipc/BrowserChild.cpp#3142) (introduced in bug 1728062) we exit early. This means the new tab forever remains in an unusable state. If we changed the early-exit condition to `if (mLayersConnected.isNothing())` that would fix this. (As the value is `Some(false)`). Sotaro, do you remember if doing that would still fix bug 1728062?
Bug 1774201 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I discovered this while investigating bug 1772839. I commented out the `DestroyEGLContext` line [here](https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/gfx/webrender_bindings/RenderCompositorEGL.cpp#149). This means that when you switch to a new tab, pausing the old compositor does not destroy the EGL surface. Therefore when we attempt to resume the new compositor, it fails, and we end up restarting the GPU process. This could occur in the wild if we encounter a WebRender error during initialization. Because the GPU process has died while the content process is in the middle of `RecvInitRendering`, creating the WebRenderLayerManager fails, and we set `mLayersConnected = Some(false)` [here](https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/dom/ipc/BrowserChild.cpp#2816). Once the GPU process has been restarted, we call `ReinitRendering`. However, due to [this line](https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/dom/ipc/BrowserChild.cpp#3142) (introduced in bug 1728062) we exit early. This means the new tab forever remains in an unusable state. If we changed the early-exit condition to `if (mLayersConnected.isNothing())` that would fix this. (As the value is `Some(false)`). Sotaro, do you remember if doing that would still fix bug 1728062?