From 9e91451e1ab6e357ac3c69a1cbb4ae0949586e55 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Tue, 23 Feb 2016 21:27:46 -0800 Subject: [PATCH] Back out 6a24b31747be (bug 1232042) for crashes @RecvForcePresent CLOSED TREE --- gfx/layers/Compositor.h | 2 -- gfx/layers/composite/LayerManagerComposite.h | 2 -- gfx/layers/d3d11/CompositorD3D11.h | 2 -- gfx/layers/ipc/CompositorParent.cpp | 8 -------- gfx/layers/ipc/CompositorParent.h | 1 - gfx/layers/ipc/PCompositor.ipdl | 4 ---- widget/windows/nsWindow.h | 2 -- widget/windows/nsWindowGfx.cpp | 17 ++--------------- 8 files changed, 2 insertions(+), 36 deletions(-) diff --git a/gfx/layers/Compositor.h b/gfx/layers/Compositor.h index 05a4a8505f4..1ec0fe763bd 100644 --- a/gfx/layers/Compositor.h +++ b/gfx/layers/Compositor.h @@ -450,8 +450,6 @@ public: */ 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; } diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index c4eae5b1a5f..c74b7ec2780 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -285,8 +285,6 @@ public: // overlay. void SetWindowOverlayChanged() { mWindowOverlayChanged = true; } - void ForcePresent() { mCompositor->ForcePresent(); } - private: /** Region we're clipping our current drawing to. */ nsIntRegion mClippingRegion; diff --git a/gfx/layers/d3d11/CompositorD3D11.h b/gfx/layers/d3d11/CompositorD3D11.h index a2858442936..1621e039182 100644 --- a/gfx/layers/d3d11/CompositorD3D11.h +++ b/gfx/layers/d3d11/CompositorD3D11.h @@ -143,8 +143,6 @@ public: return LayersBackend::LAYERS_D3D11; } - virtual void ForcePresent() { mSwapChain->Present(0, 0); } - virtual nsIWidget* GetWidget() const override { return mWidget; } ID3D11Device* GetDevice() { return mDevice; } diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 97e4064c975..4dd4e1cbdca 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -872,13 +872,6 @@ CompositorParent::RecvFlushRendering() return true; } -bool -CompositorParent::RecvForcePresent() -{ - mLayerManager->ForcePresent(); - return true; -} - bool CompositorParent::RecvGetTileSize(int32_t* aWidth, int32_t* aHeight) { @@ -1912,7 +1905,6 @@ public: 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* intervals) override { return true; } diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h index a226920b418..470c5b51491 100644 --- a/gfx/layers/ipc/CompositorParent.h +++ b/gfx/layers/ipc/CompositorParent.h @@ -237,7 +237,6 @@ public: 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; diff --git a/gfx/layers/ipc/PCompositor.ipdl b/gfx/layers/ipc/PCompositor.ipdl index d52cc41e819..94e44e5ffaa 100644 --- a/gfx/layers/ipc/PCompositor.ipdl +++ b/gfx/layers/ipc/PCompositor.ipdl @@ -140,10 +140,6 @@ parent: // 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); diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index 315bd7f67ab..505558b95f6 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -263,8 +263,6 @@ public: static void ClearCompositor(nsWindow* aWindow); - void ForcePresent(); - /** * AssociateDefaultIMC() associates or disassociates the default IMC for * the window. diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index bf5d8e261e7..2399dff9199 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -43,7 +43,6 @@ using mozilla::plugins::PluginInstanceParent; #include "nsIXULRuntime.h" #include "mozilla/layers/CompositorParent.h" -#include "mozilla/layers/CompositorChild.h" #include "ClientLayerManager.h" #include "nsUXThemeData.h" @@ -167,13 +166,6 @@ nsIWidgetListener* nsWindow::GetPaintListener() 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 @@ -524,13 +516,8 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) } break; case LayersBackend::LAYERS_CLIENT: - { - result = listener->PaintWindow( - this, LayoutDeviceIntRegion::FromUnknownRegion(region)); - nsCOMPtr event = - NS_NewRunnableMethod(this, &nsWindow::ForcePresent); - NS_DispatchToMainThread(event); - } + result = listener->PaintWindow( + this, LayoutDeviceIntRegion::FromUnknownRegion(region)); break; default: NS_ERROR("Unknown layers backend used!");