SF: use TextureView hint when selecting the refresh rate
SF would only try to heuristically calculate the frame rate of a layer
when TextureView is updating. This fixes a bug where SF tries to
heuristically calculate the frame rate for UI animations but fails
due to long frames.
Bug: 280249265
Test: Playing a video on Facebook and observe refresh rate
Test: go/cb-pcmark
Change-Id: Ic98484b8313f1e8e6ad01297b63bb64da6d4a6dd
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index a5cf8d6..44d3594 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -1871,12 +1871,14 @@
auto frameTimelineVsyncId = static_cast<int64_t>(va_arg(args, int64_t));
auto inputEventId = static_cast<int32_t>(va_arg(args, int32_t));
auto startTimeNanos = static_cast<int64_t>(va_arg(args, int64_t));
+ auto useForRefreshRateSelection = static_cast<bool>(va_arg(args, int32_t));
ALOGV("Surface::%s", __func__);
FrameTimelineInfo ftlInfo;
ftlInfo.vsyncId = frameTimelineVsyncId;
ftlInfo.inputEventId = inputEventId;
ftlInfo.startTimeNanos = startTimeNanos;
+ ftlInfo.useForRefreshRateSelection = useForRefreshRateSelection;
return setFrameTimelineInfo(frameNumber, ftlInfo);
}