Bug 1484173 - Expose the vsync interval via the CompositorVsyncSchedulerOwner interface. r=sotaro

We need this for the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D8765

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2018-10-16 00:33:51 +00:00
parent 8d30e3fa8e
commit 51d0eb31fa
4 changed files with 14 additions and 1 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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)
{

View File

@ -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;