diff options
-rw-r--r-- | services/surfaceflinger/TransactionCallbackInvoker.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/services/surfaceflinger/TransactionCallbackInvoker.cpp b/services/surfaceflinger/TransactionCallbackInvoker.cpp index e5de7591ef..3da98d4247 100644 --- a/services/surfaceflinger/TransactionCallbackInvoker.cpp +++ b/services/surfaceflinger/TransactionCallbackInvoker.cpp @@ -137,7 +137,6 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>& sp<Fence> currentFence = future.get().value_or(Fence::NO_FENCE); if (prevFence == nullptr && currentFence->getStatus() != Fence::Status::Invalid) { prevFence = std::move(currentFence); - handle->previousReleaseFence = prevFence; } else if (prevFence != nullptr) { // If both fences are signaled or both are unsignaled, we need to merge // them to get an accurate timestamp. @@ -147,8 +146,7 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>& snprintf(fenceName, 32, "%.28s", handle->name.c_str()); sp<Fence> mergedFence = Fence::merge(fenceName, prevFence, currentFence); if (mergedFence->isValid()) { - handle->previousReleaseFence = std::move(mergedFence); - prevFence = handle->previousReleaseFence; + prevFence = std::move(mergedFence); } } else if (currentFence->getStatus() == Fence::Status::Unsignaled) { // If one fence has signaled and the other hasn't, the unsignaled @@ -158,10 +156,11 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>& // by this point, they will have both signaled and only the timestamp // will be slightly off; any dependencies after this point will // already have been met. - handle->previousReleaseFence = std::move(currentFence); + prevFence = std::move(currentFence); } } } + handle->previousReleaseFence = prevFence; handle->previousReleaseFences.clear(); FrameEventHistoryStats eventStats(handle->frameNumber, |