From 5513c615e75640ca45b9ffdfa378f75e8f28f0f6 Mon Sep 17 00:00:00 2001 From: chaviw Date: Wed, 15 Sep 2021 15:26:23 -0500 Subject: [PATCH] Update setBuffer to use the new setBuffer API Transaction.setAcquireFence is removed and instead the fence can be sent directly in the setBuffer call. Test: Chrome works Fixes: 200065015 Change-Id: I248f07d7ce5a3faa0d7482fe4e0e7b33f3cfea55 --- native/android/surface_control.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index 7f74dd4c33c31..ceba4d60bed0e 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -366,11 +366,11 @@ void ASurfaceTransaction_setBuffer(ASurfaceTransaction* aSurfaceTransaction, sp graphic_buffer(reinterpret_cast(buffer)); - transaction->setBuffer(surfaceControl, graphic_buffer); + std::optional> fence = std::nullopt; if (acquire_fence_fd != -1) { - sp fence = new Fence(acquire_fence_fd); - transaction->setAcquireFence(surfaceControl, fence); + fence = new Fence(acquire_fence_fd); } + transaction->setBuffer(surfaceControl, graphic_buffer, fence); } void ASurfaceTransaction_setGeometry(ASurfaceTransaction* aSurfaceTransaction,