Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af854679 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Add transaction callback in SurfaceComposerClient::setBuffer" into...

Merge "Add transaction callback in SurfaceComposerClient::setBuffer" into tm-dev am: faa3b879 am: c68b4f11 am: f9aa9eab

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/17946878



Change-Id: Ia69f0aec68b1cb0cd10f026ee38b46d25d044e04
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3f653432 f9aa9eab
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -1495,6 +1495,18 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBuffe
    s->bufferData = std::move(bufferData);
    s->bufferData = std::move(bufferData);
    registerSurfaceControlForCallback(sc);
    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;
    mContainsBuffer = true;
    return *this;
    return *this;
}
}