Loading libs/gui/SurfaceComposerClient.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1495,6 +1495,18 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBuffe s->bufferData = std::move(bufferData); registerSurfaceControlForCallback(sc); // With the current infrastructure, a release callback will not be invoked if there's no // transaction callback in the case when a buffer is latched and not released early. This is // because the legacy implementation didn't have a release callback and sent releases in the // transaction callback. Because of this, we need to make sure to have a transaction callback // set up when a buffer is sent in a transaction to ensure the caller gets the release // callback, regardless if they set up a transaction callback. // // TODO (b/230380821): Remove when release callbacks are separated from transaction callbacks addTransactionCompletedCallback([](void*, nsecs_t, const sp<Fence>&, const std::vector<SurfaceControlStats>&) {}, nullptr); mContainsBuffer = true; return *this; } Loading Loading
libs/gui/SurfaceComposerClient.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1495,6 +1495,18 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBuffe s->bufferData = std::move(bufferData); registerSurfaceControlForCallback(sc); // With the current infrastructure, a release callback will not be invoked if there's no // transaction callback in the case when a buffer is latched and not released early. This is // because the legacy implementation didn't have a release callback and sent releases in the // transaction callback. Because of this, we need to make sure to have a transaction callback // set up when a buffer is sent in a transaction to ensure the caller gets the release // callback, regardless if they set up a transaction callback. // // TODO (b/230380821): Remove when release callbacks are separated from transaction callbacks addTransactionCompletedCallback([](void*, nsecs_t, const sp<Fence>&, const std::vector<SurfaceControlStats>&) {}, nullptr); mContainsBuffer = true; return *this; } Loading