mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
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:
parent
8d30e3fa8e
commit
51d0eb31fa
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user