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

Commit d84085a2 authored by chaviw's avatar chaviw
Browse files

Add gatherPendingTransactions in BBQ

Add a function to gather the transactions that were sent to BBQ via
the mergeWithNextTransaction. This is to allow the caller to get the
transaction in case a frame isn't drawn and we need to apply or merge
these transactions anyway.

Test: Builds and runs
Bug: 200284684
Change-Id: Ic9f3afb48e00212a6488a6a8f9cd4403ed1cb7d6
parent f06d1361
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -834,6 +834,14 @@ void BLASTBufferQueue::mergePendingTransactions(SurfaceComposerClient::Transacti
                               mPendingTransactions.end());
}

SurfaceComposerClient::Transaction* BLASTBufferQueue::gatherPendingTransactions(
        uint64_t frameNumber) {
    std::lock_guard _lock{mMutex};
    SurfaceComposerClient::Transaction* t = new SurfaceComposerClient::Transaction();
    mergePendingTransactions(t, frameNumber);
    return t;
}

// Maintains a single worker thread per process that services a list of runnables.
class AsyncWorker : public Singleton<AsyncWorker> {
private:
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ public:
    void setSyncTransaction(SurfaceComposerClient::Transaction* t, bool acquireSingleBuffer = true);
    void mergeWithNextTransaction(SurfaceComposerClient::Transaction* t, uint64_t frameNumber);
    void applyPendingTransactions(uint64_t frameNumber);
    SurfaceComposerClient::Transaction* gatherPendingTransactions(uint64_t frameNumber);

    void update(const sp<SurfaceControl>& surface, uint32_t width, uint32_t height, int32_t format,
                SurfaceComposerClient::Transaction* outTransaction = nullptr);