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

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

Merge "Only add commit callback when using sync transaction" into sc-v2-dev am: 3316c977

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

Change-Id: I062aec8407adf5862897bcf30cb70c13dbb04b98
parents 815a7f7a 3316c977
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -529,7 +529,6 @@ void BLASTBufferQueue::acquireNextBufferLocked(

    // Ensure BLASTBufferQueue stays alive until we receive the transaction complete callback.
    incStrong((void*)transactionCallbackThunk);
    incStrong((void*)transactionCommittedCallbackThunk);

    const bool sizeHasChanged = mRequestedSize != mSize;
    mSize = mRequestedSize;
@@ -550,7 +549,7 @@ void BLASTBufferQueue::acquireNextBufferLocked(
    t->setAcquireFence(mSurfaceControl,
                       bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE);
    t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this));
    t->addTransactionCommittedCallback(transactionCommittedCallbackThunk, static_cast<void*>(this));

    mSurfaceControlsWithPendingCallback.push(mSurfaceControl);

    if (updateDestinationFrame) {
@@ -673,6 +672,13 @@ void BLASTBufferQueue::onFrameAvailable(const BufferItem& item) {

    if (nextTransactionSet) {
        acquireNextBufferLocked(std::move(mNextTransaction));

        // Only need a commit callback when syncing to ensure the buffer that's synced has been sent
        // to SF
        incStrong((void*)transactionCommittedCallbackThunk);
        mNextTransaction->addTransactionCommittedCallback(transactionCommittedCallbackThunk,
                                                          static_cast<void*>(this));

        mNextTransaction = nullptr;
        mWaitForTransactionCallback = true;
    } else if (!mWaitForTransactionCallback) {