Add optional parameter to IVsyncSource::vsyncDeadlineAfter
vsyncDeadlineAfter just forwards its parameter to
VSyncTracker::nextAnticipatedVSyncTimeFrom, but the latter has an
optional parameter, too. Adding the optional parameter to
vsyncDeadlineAfter allows Scheduler::getNextFrameInterval to call it
directly. This will further help to move getNextFrameInterval's impl
into FrameTargeter::beginFrame, in
I229e09ccd760341268423fd4ba1ecc5105186f10.
Use Android's TimePoint and related classes directly in
getNextFrameInterval.
Bug: 315371484
Test: atest libscheduler_test:SchedulerTest#nextFrameIntervalTest
Change-Id: I1ede36d692b82a1f7276071fa558decced743334
diff --git a/services/surfaceflinger/Scheduler/VsyncSchedule.h b/services/surfaceflinger/Scheduler/VsyncSchedule.h
index 722ea0b..6f656d2 100644
--- a/services/surfaceflinger/Scheduler/VsyncSchedule.h
+++ b/services/surfaceflinger/Scheduler/VsyncSchedule.h
@@ -63,7 +63,8 @@
// IVsyncSource overrides:
Period period() const override;
- TimePoint vsyncDeadlineAfter(TimePoint) const override;
+ TimePoint vsyncDeadlineAfter(TimePoint,
+ ftl::Optional<TimePoint> lastVsyncOpt = {}) const override;
Period minFramePeriod() const override;
// Inform the schedule that the display mode changed the schedule needs to recalibrate