diff options
| author | 2022-06-29 17:23:05 +0000 | |
|---|---|---|
| committer | 2022-06-29 17:23:05 +0000 | |
| commit | 552bdbb3f7e423c4047ed209917a12f8cadf86e9 (patch) | |
| tree | db84b827307260c3e1e05d5d30a08c08d427e158 /libs/gui/SurfaceControl.cpp | |
| parent | ae30141ed1e6ac0f9a41a14012a9f072034b3f70 (diff) | |
| parent | ad3a19985dcb7cd8bc76ce203b26b28765112bf4 (diff) | |
Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: Id23fa2f0004319f4ee592e19dc34a6b74cdb644f
Change-Id: I146284f445cfeff49cab8b93e5a6a97b4a0e0eaa
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
| -rw-r--r-- | libs/gui/SurfaceControl.cpp | 14 |
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 |