Revert "Ensure our transaction arrives at the compositor before asking the parent to paint"
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 17 May 2017 10:44:33 -0400
changeset 407441 1eb562b4804d98dba19d3865fb67d8e7f8e7cd62
parent 407440 e0ec2a72700f6d445f5f21b42327028617928d90
child 407442 33adaa3e80315b3883250b30b9a71a656ab36bc2
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone55.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
Revert "Ensure our transaction arrives at the compositor before asking the parent to paint" This reverts commit e0ec2a72700f.
dom/base/nsDOMWindowUtils.cpp
gfx/layers/Layers.h
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/ipc/CompositorBridgeParent.h
gfx/layers/ipc/CrossProcessCompositorBridgeParent.h
gfx/layers/ipc/PCompositorBridge.ipdl
gfx/layers/wr/WebRenderLayerManager.cpp
gfx/layers/wr/WebRenderLayerManager.h
ipc/ipdl/sync-messages.ini
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -333,17 +333,16 @@ nsDOMWindowUtils::UpdateLayerTree()
 {
   if (nsIPresShell* presShell = GetPresShell()) {
     presShell->FlushPendingNotifications(FlushType::Display);
     RefPtr<nsViewManager> vm = presShell->GetViewManager();
     nsView* view = vm->GetRootView();
     if (view) {
       presShell->Paint(view, view->GetBounds(),
           nsIPresShell::PAINT_LAYERS | nsIPresShell::PAINT_SYNC_DECODE_IMAGES);
-      presShell->GetLayerManager()->WaitOnTransactionProcessed();
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetContentViewerSize(uint32_t *aDisplayWidth, uint32_t *aDisplayHeight)
 {
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -591,21 +591,16 @@ public:
    * Make sure that the previous transaction has been entirely
    * completed.
    *
    * Note: This may sychronously wait on a remote compositor
    * to complete rendering.
    */
   virtual void FlushRendering() { }
 
-  /**
-   * Make sure that the previous transaction has been
-   * received. This will synchronsly wait on a remote compositor. */
-  virtual void WaitOnTransactionProcessed() { }
-
   virtual void SendInvalidRegion(const nsIntRegion& aRegion) {}
 
   /**
    * Checks if we need to invalidate the OS widget to trigger
    * painting when updating this layer manager.
    */
   virtual bool NeedsWidgetInvalidation() { return true; }
 
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -652,24 +652,16 @@ ClientLayerManager::FlushRendering()
       } else {
         remoteRenderer->SendFlushRenderingAsync();
       }
     }
   }
 }
 
 void
-ClientLayerManager::WaitOnTransactionProcessed()
-{
-  CompositorBridgeChild* remoteRenderer = GetCompositorBridgeChild();
-  if (remoteRenderer) {
-    remoteRenderer->SendWaitOnTransactionProcessed();
-  }
-}
-void
 ClientLayerManager::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier,
                                                    uint64_t aDeviceResetSeqNo)
 {
   MOZ_ASSERT_IF(XRE_IsContentProcess(),
                 aDeviceResetSeqNo == CompositorBridgeChild::Get()->DeviceResetSequenceNumber());
 
   mForwarder->IdentifyTextureHost(aNewIdentifier);
   mDeviceResetSequenceNumber = aDeviceResetSeqNo;
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -109,17 +109,16 @@ public:
   virtual void UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier,
 											  uint64_t aDeviceResetSeqNo) override;
   virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override
   {
     return AsShadowForwarder()->GetTextureFactoryIdentifier();
   }
 
   virtual void FlushRendering() override;
-  virtual void WaitOnTransactionProcessed() override;
   virtual void SendInvalidRegion(const nsIntRegion& aRegion) override;
 
   virtual uint32_t StartFrameTimeRecording(int32_t aBufferSize) override;
 
   virtual void StopFrameTimeRecording(uint32_t         aStartIndex,
                                       nsTArray<float>& aFrameIntervals) override;
 
   virtual bool NeedsWidgetInvalidation() override { return false; }
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -519,22 +519,16 @@ CompositorBridgeParent::RecvMakeSnapshot
     // of error to the child process and let it deal with it...
     return IPC_FAIL_NO_REASON(this);
   }
   ForceComposeToTarget(target, &aRect);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-CompositorBridgeParent::RecvWaitOnTransactionProcessed()
-{
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
 CompositorBridgeParent::RecvFlushRendering()
 {
   if (mCompositorScheduler->NeedsComposite()) {
     CancelCurrentCompositeTask();
     ForceComposeToTarget(nullptr);
   }
   return IPC_OK();
 }
--- a/gfx/layers/ipc/CompositorBridgeParent.h
+++ b/gfx/layers/ipc/CompositorBridgeParent.h
@@ -194,17 +194,16 @@ public:
   virtual mozilla::ipc::IPCResult RecvNotifyChildCreated(const uint64_t& child, CompositorOptions* aOptions) override;
   virtual mozilla::ipc::IPCResult RecvMapAndNotifyChildCreated(const uint64_t& child, const base::ProcessId& pid, CompositorOptions* aOptions) override;
   virtual mozilla::ipc::IPCResult RecvNotifyChildRecreated(const uint64_t& child, CompositorOptions* aOptions) override;
   virtual mozilla::ipc::IPCResult RecvAdoptChild(const uint64_t& child) override;
   virtual mozilla::ipc::IPCResult RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
                                 const gfx::IntRect& aRect) override;
   virtual mozilla::ipc::IPCResult RecvFlushRendering() override;
   virtual mozilla::ipc::IPCResult RecvFlushRenderingAsync() override;
-  virtual mozilla::ipc::IPCResult RecvWaitOnTransactionProcessed() override;
   virtual mozilla::ipc::IPCResult RecvForcePresent() override;
 
   virtual mozilla::ipc::IPCResult RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override;
   virtual mozilla::ipc::IPCResult RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override;
   virtual mozilla::ipc::IPCResult RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override;
 
   // Unused for chrome <-> compositor communication (which this class does).
   // @see CrossProcessCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint
--- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h
+++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h
@@ -55,17 +55,16 @@ public:
   virtual mozilla::ipc::IPCResult RecvNotifyChildRecreated(const uint64_t& child, CompositorOptions* aOptions) override { return IPC_FAIL_NO_REASON(this); }
   virtual mozilla::ipc::IPCResult RecvAdoptChild(const uint64_t& child) override { return IPC_FAIL_NO_REASON(this); }
   virtual mozilla::ipc::IPCResult RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
                                 const gfx::IntRect& aRect) override
   { return IPC_OK(); }
   virtual mozilla::ipc::IPCResult RecvFlushRendering() override { return IPC_OK(); }
   virtual mozilla::ipc::IPCResult RecvFlushRenderingAsync() override { return IPC_OK(); }
   virtual mozilla::ipc::IPCResult RecvForcePresent() override { return IPC_OK(); }
-  virtual mozilla::ipc::IPCResult RecvWaitOnTransactionProcessed() override { return IPC_OK(); }
   virtual mozilla::ipc::IPCResult RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override { return IPC_OK(); }
   virtual mozilla::ipc::IPCResult RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override { return IPC_OK(); }
   virtual mozilla::ipc::IPCResult RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override  { return IPC_OK(); }
 
   virtual mozilla::ipc::IPCResult RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId,
                                                     const uint32_t& aPresShellId) override;
 
   virtual mozilla::ipc::IPCResult RecvNotifyApproximatelyVisibleRegion(const ScrollableLayerGuid& aGuid,
--- a/gfx/layers/ipc/PCompositorBridge.ipdl
+++ b/gfx/layers/ipc/PCompositorBridge.ipdl
@@ -189,19 +189,16 @@ parent:
   // Make sure any pending composites are started immediately and
   // block until they are completed.
   sync FlushRendering();
 
   // Same as FlushRendering, but asynchronous, since not all platforms require
   // synchronous repaints on resize.
   async FlushRenderingAsync();
 
-  // Make sure any pending composites have been received.
-  sync WaitOnTransactionProcessed();
-
   // Force an additional frame presentation to be executed. This is used to
   // work around a windows presentation bug (See Bug 1232042)
   async ForcePresent();
 
   sync StartFrameTimeRecording(int32_t bufferSize)
     returns (uint32_t startIndex);
 
   sync StopFrameTimeRecording(uint32_t startIndex)
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -102,17 +102,17 @@ WebRenderLayerManager::~WebRenderLayerMa
 {
   Destroy();
   MOZ_COUNT_DTOR(WebRenderLayerManager);
 }
 
 CompositorBridgeChild*
 WebRenderLayerManager::GetCompositorBridgeChild()
 {
-  return WrBridge()->GetCompositorBridgeChild();
+  return mWidget ? mWidget->GetRemoteRenderer() : nullptr;
 }
 
 int32_t
 WebRenderLayerManager::GetMaxTextureSize() const
 {
   return WrBridge()->GetMaxTextureSize();
 }
 
@@ -468,25 +468,16 @@ WebRenderLayerManager::FlushRendering()
 {
   CompositorBridgeChild* bridge = GetCompositorBridgeChild();
   if (bridge) {
     bridge->SendFlushRendering();
   }
 }
 
 void
-WebRenderLayerManager::WaitOnTransactionProcessed()
-{
-  CompositorBridgeChild* bridge = GetCompositorBridgeChild();
-  if (bridge) {
-    bridge->SendWaitOnTransactionProcessed();
-  }
-}
-
-void
 WebRenderLayerManager::SendInvalidRegion(const nsIntRegion& aRegion)
 {
   // XXX Webrender does not support invalid region yet.
 }
 
 void
 WebRenderLayerManager::Composite()
 {
--- a/gfx/layers/wr/WebRenderLayerManager.h
+++ b/gfx/layers/wr/WebRenderLayerManager.h
@@ -83,17 +83,16 @@ public:
 
   virtual void SetTransactionIdAllocator(TransactionIdAllocator* aAllocator) override
   { mTransactionIdAllocator = aAllocator; }
 
   virtual void AddDidCompositeObserver(DidCompositeObserver* aObserver) override;
   virtual void RemoveDidCompositeObserver(DidCompositeObserver* aObserver) override;
 
   virtual void FlushRendering() override;
-  virtual void WaitOnTransactionProcessed() override;
 
   virtual void SendInvalidRegion(const nsIntRegion& aRegion) override;
 
   virtual void Composite() override;
 
   virtual void SetNeedsComposite(bool aNeedsComposite) override
   {
     mNeedsComposite = aNeedsComposite;
--- a/ipc/ipdl/sync-messages.ini
+++ b/ipc/ipdl/sync-messages.ini
@@ -990,18 +990,16 @@ description =
 [PCompositorBridge::MapAndNotifyChildCreated]
 description = bug 1350660
 [PCompositorBridge::NotifyChildRecreated]
 description =
 [PCompositorBridge::MakeSnapshot]
 description =
 [PCompositorBridge::FlushRendering]
 description =
-[PCompositorBridge::WaitOnTransactionProcessed]
-description = bug 1364626
 [PCompositorBridge::StartFrameTimeRecording]
 description =
 [PCompositorBridge::StopFrameTimeRecording]
 description =
 [PCompositorBridge::SyncWithCompositor]
 description =
 [PCompositorBridge::PWebRenderBridge]
 description =