Back out 6a24b31747be (bug 1232042) for crashes @RecvForcePresent
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 23 Feb 2016 21:27:46 -0800
changeset 321596 640eb13b730cd4f574ba4f9579dc6d0c7bf1f575
parent 321595 6a24b31747be818caf7891d18947d6aaccf20e88
child 321597 cd2b53862f812ef4a522a39a5b2a3b3780099ed9
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1232042
milestone47.0a1
backs out6a24b31747be818caf7891d18947d6aaccf20e88
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
Back out 6a24b31747be (bug 1232042) for crashes @RecvForcePresent CLOSED TREE
gfx/layers/Compositor.h
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/d3d11/CompositorD3D11.h
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/ipc/CompositorParent.h
gfx/layers/ipc/PCompositor.ipdl
widget/windows/nsWindow.h
widget/windows/nsWindowGfx.cpp
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -445,18 +445,16 @@ public:
   virtual bool Resume() { return true; }
 
   /**
    * Call before rendering begins to ensure the compositor is ready to
    * composite. Returns false if rendering should be aborted.
    */
   virtual bool Ready() { return true; }
 
-  virtual void ForcePresent() { }
-
   // XXX I expect we will want to move mWidget into this class and implement
   // these methods properly.
   virtual nsIWidget* GetWidget() const { return nullptr; }
 
   virtual bool HasImageHostOverlays() { return false; }
 
   virtual void AddImageHostOverlay(ImageHostOverlay* aOverlay) {}
 
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -280,18 +280,16 @@ public:
     aNotifications->AppendElements(Move(mImageCompositeNotifications));
   }
 
   // Indicate that we need to composite even if nothing in our layers has
   // changed, so that the widget can draw something different in its window
   // overlay.
   void SetWindowOverlayChanged() { mWindowOverlayChanged = true; }
 
-  void ForcePresent() { mCompositor->ForcePresent(); }
-
 private:
   /** Region we're clipping our current drawing to. */
   nsIntRegion mClippingRegion;
   gfx::IntRect mRenderBounds;
 
   /** Current root layer. */
   LayerComposite* RootLayer() const;
 
--- a/gfx/layers/d3d11/CompositorD3D11.h
+++ b/gfx/layers/d3d11/CompositorD3D11.h
@@ -138,18 +138,16 @@ public:
 #ifdef MOZ_DUMP_PAINTING
   virtual const char* Name() const override { return "Direct3D 11"; }
 #endif
 
   virtual LayersBackend GetBackendType() const override {
     return LayersBackend::LAYERS_D3D11;
   }
 
-  virtual void ForcePresent() { mSwapChain->Present(0, 0); }
-
   virtual nsIWidget* GetWidget() const override { return mWidget; }
 
   ID3D11Device* GetDevice() { return mDevice; }
 
   ID3D11DeviceContext* GetDC() { return mContext; }
 
 private:
   enum Severity {
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -868,23 +868,16 @@ CompositorParent::RecvFlushRendering()
   {
     CancelCurrentCompositeTask();
     ForceComposeToTarget(nullptr);
   }
   return true;
 }
 
 bool
-CompositorParent::RecvForcePresent()
-{
-  mLayerManager->ForcePresent();
-  return true;
-}
-
-bool
 CompositorParent::RecvGetTileSize(int32_t* aWidth, int32_t* aHeight)
 {
   *aWidth = gfxPlatform::GetPlatform()->GetTileWidth();
   *aHeight = gfxPlatform::GetPlatform()->GetTileHeight();
   return true;
 }
 
 bool
@@ -1907,17 +1900,16 @@ public:
   virtual bool RecvNotifyChildCreated(const uint64_t& child) override;
   virtual bool RecvAdoptChild(const uint64_t& child) override { return false; }
   virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
                                 const gfx::IntRect& aRect) override
   { return true; }
   virtual bool RecvMakeWidgetSnapshot(const SurfaceDescriptor& aInSnapshot) override
   { return true; }
   virtual bool RecvFlushRendering() override { return true; }
-  virtual bool RecvForcePresent() override { return true; }
   virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override { return true; }
   virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override { return true; }
   virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override  { return true; }
   virtual bool RecvGetTileSize(int32_t* aWidth, int32_t* aHeight) override
   {
     *aWidth = gfxPlatform::GetPlatform()->GetTileWidth();
     *aHeight = gfxPlatform::GetPlatform()->GetTileHeight();
     return true;
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -232,17 +232,16 @@ public:
   virtual bool RecvNotifyHidden(const uint64_t& id) override { return true; }
   virtual bool RecvNotifyVisible(const uint64_t& id) override { return true; }
   virtual bool RecvNotifyChildCreated(const uint64_t& child) override;
   virtual bool RecvAdoptChild(const uint64_t& child) override;
   virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
                                 const gfx::IntRect& aRect) override;
   virtual bool RecvMakeWidgetSnapshot(const SurfaceDescriptor& aInSnapshot) override;
   virtual bool RecvFlushRendering() override;
-  virtual bool RecvForcePresent() override;
 
   virtual bool RecvGetTileSize(int32_t* aWidth, int32_t* aHeight) override;
 
   virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override;
   virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override;
   virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override;
 
   // Unused for chrome <-> compositor communication (which this class does).
--- a/gfx/layers/ipc/PCompositor.ipdl
+++ b/gfx/layers/ipc/PCompositor.ipdl
@@ -135,20 +135,16 @@ parent:
   // This call is part of IPDL, even though it simply wraps an nsIWidget
   // call, to make sure it does not occur in the middle of a composite.
   sync MakeWidgetSnapshot(SurfaceDescriptor inSnapshot);
 
   // Make sure any pending composites are started immediately and
   // block until they are completed.
   sync FlushRendering();
 
-  // Force an additional frame presentation to be executed. This is used to
-  // work around a windows presentation bug (See Bug 1232042)
-  async ForcePresent();
-
   // Get the size of the tiles. This number should not change at runtime.
   sync GetTileSize()
     returns (int32_t tileWidth, int32_t tileHeight);
 
   sync StartFrameTimeRecording(int32_t bufferSize)
     returns (uint32_t startIndex);
 
   sync StopFrameTimeRecording(uint32_t startIndex)
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -258,18 +258,16 @@ public:
   /**
    * Misc.
    */
   virtual bool            AutoErase(HDC dc);
   bool ComputeShouldAccelerate() override;
 
   static void             ClearCompositor(nsWindow* aWindow);
 
-  void                    ForcePresent();
-
   /**
    * AssociateDefaultIMC() associates or disassociates the default IMC for
    * the window.
    *
    * @param aAssociate    TRUE, associates the default IMC with the window.
    *                      Otherwise, disassociates the default IMC from the
    *                      window.
    * @return              TRUE if this method associated the default IMC with
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -38,17 +38,16 @@ using mozilla::plugins::PluginInstancePa
 #include "prmem.h"
 #include "WinUtils.h"
 #include "nsIWidgetListener.h"
 #include "mozilla/unused.h"
 #include "nsDebug.h"
 #include "nsIXULRuntime.h"
 
 #include "mozilla/layers/CompositorParent.h"
-#include "mozilla/layers/CompositorChild.h"
 #include "ClientLayerManager.h"
 
 #include "nsUXThemeData.h"
 #include "nsUXThemeConstants.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
@@ -162,23 +161,16 @@ EnsureSharedSurfaceSize(IntSize size)
 
 nsIWidgetListener* nsWindow::GetPaintListener()
 {
   if (mDestroyCalled)
     return nullptr;
   return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;
 }
 
-void nsWindow::ForcePresent()
-{
-  if (CompositorChild* remoteRenderer = GetRemoteRenderer()) {
-    remoteRenderer->SendForcePresent();
-  }
-}
-
 bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
 {
   // We never have reentrant paint events, except when we're running our RPC
   // windows event spin loop. If we don't trap for this, we'll try to paint,
   // but view manager will refuse to paint the surface, resulting is black
   // flashes on the plugin rendering surface.
   if (mozilla::ipc::MessageChannel::IsSpinLoopActive() && mPainting)
     return false;
@@ -519,23 +511,18 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t
                             (BITMAPINFO*) &bi,
                             DIB_RGB_COLORS,
                             SRCCOPY);
             }
           }
         }
         break;
       case LayersBackend::LAYERS_CLIENT:
-        {
-          result = listener->PaintWindow(
-            this, LayoutDeviceIntRegion::FromUnknownRegion(region));
-          nsCOMPtr<nsIRunnable> event =
-            NS_NewRunnableMethod(this, &nsWindow::ForcePresent);
-          NS_DispatchToMainThread(event);
-        }
+        result = listener->PaintWindow(
+          this, LayoutDeviceIntRegion::FromUnknownRegion(region));
         break;
       default:
         NS_ERROR("Unknown layers backend used!");
         break;
     }
   }
 
   if (!aDC) {