[SurfaceFlinger] correct present time for negative phase offsets
DispSync::expectedPresentTime returns the expected presentation time for
the current frame, but when we're in negative offsets we are targetting
the following frame instead.
Bug: 133241520
Bug: 134589085
Test: systrace when flinging through news
Change-Id: I7cc05a0b9e8e9b5c3e8d0c4b1d59b0a7dabd43d4
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 74fefa7..3d98ec1 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -298,6 +298,11 @@
// TODO: this should be made accessible only to MessageQueue
void onMessageReceived(int32_t what);
+ // Returns the expected present time for this frame.
+ // When we are in negative offsets, we perform a correction so that the
+ // predicted vsync for the *next* frame is used instead.
+ nsecs_t getExpectedPresentTime();
+
// for debugging only
// TODO: this should be made accessible only to HWComposer
const Vector<sp<Layer>>& getLayerSortedByZForHwcDisplay(DisplayId displayId);