SF: change the render rate directly instead of starting a new VsyncTimeline
So we would preserve the old vsync cadence
Bug: 328140524
Change-Id: Ibdd4e49ab5494605e39957cedc6fba00146d18d9
Test: presubmit
diff --git a/services/surfaceflinger/Scheduler/VSyncPredictor.h b/services/surfaceflinger/Scheduler/VSyncPredictor.h
index c840cbd..3ed1d41 100644
--- a/services/surfaceflinger/Scheduler/VSyncPredictor.h
+++ b/services/surfaceflinger/Scheduler/VSyncPredictor.h
@@ -97,6 +97,7 @@
std::optional<TimePoint> validUntil() const { return mValidUntil; }
bool isVSyncInPhase(Model, nsecs_t vsync, Fps frameRate);
void shiftVsyncSequence(Duration phase);
+ void setRenderRate(Fps renderRate) { mRenderRateOpt = renderRate; }
private:
nsecs_t snapToVsyncAlignedWithRenderRate(Model model, nsecs_t vsync);
@@ -104,7 +105,7 @@
std::optional<VsyncSequence> makeVsyncSequence(TimePoint knownVsync);
const Period mIdealPeriod = Duration::fromNs(0);
- const std::optional<Fps> mRenderRateOpt;
+ std::optional<Fps> mRenderRateOpt;
std::optional<TimePoint> mValidUntil;
std::optional<VsyncSequence> mLastVsyncSequence;
};