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
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index dd96683..6bcbea1 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -834,6 +834,14 @@
                                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: