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

Commit d53226fe authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add SurfaceComposerClient::Transaction clear api"

parents 91cf2ce5 fef244ee
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -425,7 +425,6 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr
            mComposerStates[kv.first].state.merge(kv.second.state);
        }
    }
    other.mComposerStates.clear();

    for (auto const& state : other.mDisplayStates) {
        ssize_t index = mDisplayStates.indexOf(state);
@@ -435,7 +434,6 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr
            mDisplayStates.editItemAt(static_cast<size_t>(index)).merge(state);
        }
    }
    other.mDisplayStates.clear();

    for (const auto& [listener, callbackInfo] : other.mListenerCallbacks) {
        auto& [callbackIds, surfaceControls] = callbackInfo;
@@ -446,17 +444,27 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr
                .surfaceControls.insert(std::make_move_iterator(surfaceControls.begin()),
                                        std::make_move_iterator(surfaceControls.end()));
    }
    other.mListenerCallbacks.clear();

    mInputWindowCommands.merge(other.mInputWindowCommands);
    other.mInputWindowCommands.clear();

    mContainsBuffer = other.mContainsBuffer;
    other.mContainsBuffer = false;

    other.clear();
    return *this;
}

void SurfaceComposerClient::Transaction::clear() {
    mComposerStates.clear();
    mDisplayStates.clear();
    mListenerCallbacks.clear();
    mInputWindowCommands.clear();
    mContainsBuffer = false;
    mForceSynchronous = 0;
    mTransactionNestCount = 0;
    mAnimation = false;
    mEarlyWakeup = false;
    mDesiredPresentTime = -1;
}

void SurfaceComposerClient::doDropReferenceTransaction(const sp<IBinder>& handle,
        const sp<ISurfaceComposerClient>& client) {
    sp<ISurfaceComposer> sf(ComposerService::getComposerService());
+3 −0
Original line number Diff line number Diff line
@@ -331,6 +331,9 @@ public:
        status_t writeToParcel(Parcel* parcel) const override;
        status_t readFromParcel(const Parcel* parcel) override;

        // Clears the contents of the transaction without applying it.
        void clear();

        status_t apply(bool synchronous = false);
        // Merge another transaction in to this one, clearing other
        // as if it had been applied.