diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 87e6fb79d8c4..c19fb6aec84a 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -645,7 +645,7 @@ mozilla::ipc::IPCResult CompositorBridgeParent::RecvForcePresent() { if (mWrBridge) { - mWrBridge->ScheduleGenerateFrame(); + mWrBridge->ScheduleForcedGenerateFrame(); } // During the shutdown sequence mLayerManager may be null if (mLayerManager) { diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index 464be3376015..014161c83446 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -1389,18 +1389,23 @@ WebRenderBridgeParent::UpdateWebRender(CompositorVsyncScheduler* aScheduler, mozilla::ipc::IPCResult WebRenderBridgeParent::RecvScheduleComposite() +{ + ScheduleGenerateFrame(); + return IPC_OK(); +} + +void +WebRenderBridgeParent::ScheduleForcedGenerateFrame() { if (mDestroyed) { - return IPC_OK(); + return; } - // Force frame rendering during next frame generation. wr::TransactionBuilder fastTxn(/* aUseSceneBuilderThread */ false); fastTxn.InvalidateRenderedFrame(); mApi->SendTransaction(fastTxn); ScheduleGenerateFrame(); - return IPC_OK(); } mozilla::ipc::IPCResult diff --git a/gfx/layers/wr/WebRenderBridgeParent.h b/gfx/layers/wr/WebRenderBridgeParent.h index 1f1f891f1ece..61af38500de0 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.h +++ b/gfx/layers/wr/WebRenderBridgeParent.h @@ -186,6 +186,14 @@ public: */ void ScheduleGenerateFrame(); + /** + * Schedule forced frame rendering at next composite timing. + * + * WebRender could skip frame rendering if there is no update. + * This function is used to force rendering even when there is not update. + */ + void ScheduleForcedGenerateFrame(); + wr::Epoch UpdateWebRender(CompositorVsyncScheduler* aScheduler, wr::WebRenderAPI* aApi, AsyncImagePipelineManager* aImageMgr,