diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index 9c5389ac191a..0a0f8775f903 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -481,7 +481,7 @@ public: return mOptions; } - TimeDuration GetVsyncInterval() const { + TimeDuration GetVsyncInterval() const override { // the variable is called "rate" but really it's an interval return mVsyncRate; } diff --git a/gfx/layers/ipc/CompositorVsyncSchedulerOwner.h b/gfx/layers/ipc/CompositorVsyncSchedulerOwner.h index c8acb39814ab..543644a87ce7 100644 --- a/gfx/layers/ipc/CompositorVsyncSchedulerOwner.h +++ b/gfx/layers/ipc/CompositorVsyncSchedulerOwner.h @@ -21,6 +21,7 @@ public: virtual bool IsPendingComposite() = 0; virtual void FinishPendingComposite() = 0; virtual void CompositeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr) = 0; + virtual TimeDuration GetVsyncInterval() const = 0; }; } // namespace layers diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index 014161c83446..af6f14d161c8 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -1607,6 +1607,17 @@ WebRenderBridgeParent::CompositeToTarget(gfx::DrawTarget* aTarget, const gfx::In MaybeGenerateFrame(/* aForceGenerateFrame */ false); } +TimeDuration +WebRenderBridgeParent::GetVsyncInterval() const +{ + // This function should only get called in the root WRBP + MOZ_ASSERT(IsRootWebRenderBridgeParent()); + if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) { + return cbp->GetVsyncInterval(); + } + return TimeDuration(); +} + void WebRenderBridgeParent::MaybeGenerateFrame(bool aForceGenerateFrame) { diff --git a/gfx/layers/wr/WebRenderBridgeParent.h b/gfx/layers/wr/WebRenderBridgeParent.h index 61af38500de0..96310b1d3e04 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.h +++ b/gfx/layers/wr/WebRenderBridgeParent.h @@ -143,6 +143,7 @@ public: bool IsPendingComposite() override { return false; } void FinishPendingComposite() override { } void CompositeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr) override; + TimeDuration GetVsyncInterval() const override; // CompositableParentManager bool IsSameProcess() const override;