summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceControl.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2022-08-16 19:08:21 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-08-16 19:08:21 +0000
commit44732cde9e19a005def5e110140963a5c2e2f5ae (patch)
tree9a4deff758bed03ccc5ff838dc55f467c303d762 /libs/gui/SurfaceControl.cpp
parent896cdca96956b6f14e262380b34a0b04e1214b50 (diff)
parent91192c8103e78895c57d9da1fc04c8695898580f (diff)
Merge "DO NOT MERGE - Merge Android 13"
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
-rw-r--r--libs/gui/SurfaceControl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index 6529a4e51c..654fb336fe 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -70,6 +70,7 @@ SurfaceControl::SurfaceControl(const sp<SurfaceControl>& other) {
mLayerId = other->mLayerId;
mWidth = other->mWidth;
mHeight = other->mHeight;
+ mFormat = other->mFormat;
mCreateFlags = other->mCreateFlags;
}
@@ -280,5 +281,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