Bug 1752469 - Remove Gnome specific workaround using PauseCompositor(), r=gfx-reviewers,lsalzman
authorRobert Mader <robert.mader@posteo.de>
Fri, 28 Jan 2022 04:24:16 +0000
changeset 605797 224b1c5e84240858f3e41170ee366cbdc9eeddcb
parent 605796 532ca82c610b8cf3488f4014d6d10fb50a3edced
child 605798 2db711522a1f0634d79cd847fea78338a9fa16ef
push id39207
push usernfay@mozilla.com
push dateFri, 28 Jan 2022 09:47:30 +0000
treeherdermozilla-central@559c2c231f21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfx-reviewers, lsalzman
bugs1752469
milestone98.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1752469 - Remove Gnome specific workaround using PauseCompositor(), r=gfx-reviewers,lsalzman This was originally implemented in D111662 to work around a crash that otherwise would get triggered in Gnome/Mutter. The fix for that crash has been available for a couple of month now, thus remove the workaround again. This may help preventing flickering for menus in certain situations. Differential Revision: https://phabricator.services.mozilla.com/D137251
gfx/layers/NativeLayer.h
gfx/layers/NativeLayerWayland.cpp
gfx/layers/NativeLayerWayland.h
gfx/webrender_bindings/RenderCompositorNative.cpp
--- a/gfx/layers/NativeLayer.h
+++ b/gfx/layers/NativeLayer.h
@@ -53,18 +53,16 @@ class NativeLayerRoot {
       const gfx::IntSize& aSize, bool aIsOpaque,
       SurfacePoolHandle* aSurfacePoolHandle) = 0;
   virtual already_AddRefed<NativeLayer> CreateLayerForExternalTexture(
       bool aIsOpaque) = 0;
 
   virtual void AppendLayer(NativeLayer* aLayer) = 0;
   virtual void RemoveLayer(NativeLayer* aLayer) = 0;
   virtual void SetLayers(const nsTArray<RefPtr<NativeLayer>>& aLayers) = 0;
-  virtual void PauseCompositor() {}
-  virtual bool ResumeCompositor() { return true; }
 
   // Called before any layer content changes
   virtual void PrepareForCommit() {}
 
   // Publish the layer changes to the screen. Returns whether the commit was
   // successful.
   virtual bool CommitToScreen() = 0;
 
--- a/gfx/layers/NativeLayerWayland.cpp
+++ b/gfx/layers/NativeLayerWayland.cpp
@@ -344,24 +344,16 @@ void NativeLayerRootWayland::UpdateLayer
   if (!mGdkAfterPaintId && gdkWindow) {
     GdkFrameClock* frameClock = gdk_window_get_frame_clock(gdkWindow);
     mGdkAfterPaintId =
         g_signal_connect_after(frameClock, "after-paint",
                                G_CALLBACK(sAfterFrameClockAfterPaint), this);
   }
 }
 
-void NativeLayerRootWayland::PauseCompositor() {
-  MutexAutoLock lock(mMutex);
-
-  for (RefPtr<NativeLayerWayland>& layer : mSublayers) {
-    layer->EnsureParentSurface(nullptr);
-  }
-}
-
 NativeLayerWayland::NativeLayerWayland(
     const IntSize& aSize, bool aIsOpaque,
     SurfacePoolHandleWayland* aSurfacePoolHandle)
     : mMutex("NativeLayerWayland"),
       mSurfacePoolHandle(aSurfacePoolHandle),
       mSize(aSize),
       mIsOpaque(aIsOpaque) {
   MOZ_RELEASE_ASSERT(mSurfacePoolHandle,
--- a/gfx/layers/NativeLayerWayland.h
+++ b/gfx/layers/NativeLayerWayland.h
@@ -58,22 +58,16 @@ class NativeLayerRootWayland final : pub
 
   void AppendLayer(NativeLayer* aLayer) override;
   void RemoveLayer(NativeLayer* aLayer) override;
   void SetLayers(const nsTArray<RefPtr<NativeLayer>>& aLayers) override;
 
   void PrepareForCommit() override { mFrameInProcess = true; };
   bool CommitToScreen() override;
 
-  // When the compositor is paused the wl_surface of the MozContainer will
-  // get destroyed. We thus have to recreate subsurface relationships for
-  // all tiles after resume. This is a implementation specific quirk of
-  // our GTK-Wayland backend.
-  void PauseCompositor() override;
-
   void UpdateLayersOnMainThread();
   void AfterFrameClockAfterPaint();
   void RequestFrameCallback(CallbackFunc aCallbackFunc, void* aCallbackData);
 
  private:
   explicit NativeLayerRootWayland(MozContainer* aContainer);
   ~NativeLayerRootWayland();
 
--- a/gfx/webrender_bindings/RenderCompositorNative.cpp
+++ b/gfx/webrender_bindings/RenderCompositorNative.cpp
@@ -91,21 +91,19 @@ RenderedFrameId RenderCompositorNative::
   if (mNativeLayerForEntireWindow) {
     mNativeLayerForEntireWindow->NotifySurfaceReady();
     mNativeLayerRoot->CommitToScreen();
   }
 
   return frameId;
 }
 
-void RenderCompositorNative::Pause() { mNativeLayerRoot->PauseCompositor(); }
+void RenderCompositorNative::Pause() {}
 
-bool RenderCompositorNative::Resume() {
-  return mNativeLayerRoot->ResumeCompositor();
-}
+bool RenderCompositorNative::Resume() { return true; }
 
 inline layers::WebRenderCompositor RenderCompositorNative::CompositorType()
     const {
   if (gfx::gfxVars::UseWebRenderCompositor()) {
 #if defined(XP_MACOSX)
     return layers::WebRenderCompositor::CORE_ANIMATION;
 #elif defined(MOZ_WAYLAND)
     return layers::WebRenderCompositor::WAYLAND;