зеркало из https://github.com/mozilla/gecko-dev.git
Ensure our transaction arrives at the compositor before asking the parent to paint
This makes UpdateLayerTree synchronous enough to ensure that the layer transaction from the child reaches the compositor. Given the comment in http://searchfox.org/mozilla-central/rev/484d2b7f51b7aed035147bbb4a565061659d9278/dom/interfaces/base/nsIDOMWindowUtils.idl#106 this seems to be the original intent of this function anyways. Without this, we can have a race between the child talking to the compositor and the child talking to the parent talking to the compositor. This also changes GetCompositorBridgeChild to work even when the widget doesn't have a CompositorBridge
This commit is contained in:
Родитель
dc10ea1700
Коммит
b2c7a3fec1
|
@ -338,6 +338,7 @@ nsDOMWindowUtils::UpdateLayerTree()
|
|||
if (view) {
|
||||
presShell->Paint(view, view->GetBounds(),
|
||||
nsIPresShell::PAINT_LAYERS | nsIPresShell::PAINT_SYNC_DECODE_IMAGES);
|
||||
presShell->GetLayerManager()->WaitOnTransactionProcessed();
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -596,6 +596,11 @@ public:
|
|||
*/
|
||||
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) {}
|
||||
|
||||
/**
|
||||
|
|
|
@ -656,6 +656,14 @@ ClientLayerManager::FlushRendering()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::WaitOnTransactionProcessed()
|
||||
{
|
||||
CompositorBridgeChild* remoteRenderer = GetCompositorBridgeChild();
|
||||
if (remoteRenderer) {
|
||||
remoteRenderer->SendWaitOnTransactionProcessed();
|
||||
}
|
||||
}
|
||||
void
|
||||
ClientLayerManager::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier,
|
||||
uint64_t aDeviceResetSeqNo)
|
||||
|
|
|
@ -114,6 +114,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void FlushRendering() override;
|
||||
virtual void WaitOnTransactionProcessed() override;
|
||||
virtual void SendInvalidRegion(const nsIntRegion& aRegion) override;
|
||||
|
||||
virtual uint32_t StartFrameTimeRecording(int32_t aBufferSize) override;
|
||||
|
|
|
@ -523,6 +523,12 @@ CompositorBridgeParent::RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
CompositorBridgeParent::RecvWaitOnTransactionProcessed()
|
||||
{
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
CompositorBridgeParent::RecvFlushRendering()
|
||||
{
|
||||
|
|
|
@ -199,6 +199,7 @@ public:
|
|||
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;
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
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(); }
|
||||
|
|
|
@ -194,6 +194,9 @@ parent:
|
|||
// 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();
|
||||
|
|
|
@ -107,7 +107,7 @@ WebRenderLayerManager::~WebRenderLayerManager()
|
|||
CompositorBridgeChild*
|
||||
WebRenderLayerManager::GetCompositorBridgeChild()
|
||||
{
|
||||
return mWidget ? mWidget->GetRemoteRenderer() : nullptr;
|
||||
return WrBridge()->GetCompositorBridgeChild();
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
@ -472,6 +472,15 @@ WebRenderLayerManager::FlushRendering()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebRenderLayerManager::WaitOnTransactionProcessed()
|
||||
{
|
||||
CompositorBridgeChild* bridge = GetCompositorBridgeChild();
|
||||
if (bridge) {
|
||||
bridge->SendWaitOnTransactionProcessed();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebRenderLayerManager::SendInvalidRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
|
|
|
@ -88,6 +88,7 @@ public:
|
|||
virtual void RemoveDidCompositeObserver(DidCompositeObserver* aObserver) override;
|
||||
|
||||
virtual void FlushRendering() override;
|
||||
virtual void WaitOnTransactionProcessed() override;
|
||||
|
||||
virtual void SendInvalidRegion(const nsIntRegion& aRegion) override;
|
||||
|
||||
|
|
|
@ -995,6 +995,8 @@ description =
|
|||
description =
|
||||
[PCompositorBridge::FlushRendering]
|
||||
description =
|
||||
[PCompositorBridge::WaitOnTransactionProcessed]
|
||||
description = bug 1364626
|
||||
[PCompositorBridge::StartFrameTimeRecording]
|
||||
description =
|
||||
[PCompositorBridge::StopFrameTimeRecording]
|
||||
|
|
Загрузка…
Ссылка в новой задаче