summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceControl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
-rw-r--r--libs/gui/SurfaceControl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index 6529a4e51c..063dda5153 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -280,5 +280,18 @@ sp<SurfaceControl> SurfaceControl::getParentingLayer() {
return this;
}
+uint64_t SurfaceControl::resolveFrameNumber(const std::optional<uint64_t>& frameNumber) {
+ if (frameNumber.has_value()) {
+ auto ret = frameNumber.value();
+ // Set the fallback to something far enough ahead that in the unlikely event of mixed
+ // "real" frame numbers and fallback frame numbers, we still won't collide in any
+ // meaningful capacity
+ mFallbackFrameNumber = ret + 100;
+ return ret;
+ } else {
+ return mFallbackFrameNumber++;
+ }
+}
+
// ----------------------------------------------------------------------------
}; // namespace android