summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
author Chavi Weingarten <chaviw@google.com> 2022-02-09 15:41:48 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-02-09 15:41:48 +0000
commit3d421ecf426636331f6d56e669a99edcb0e1eb81 (patch)
tree9fb62908b7d6b910c1807b840334e923ebfbdc63 /graphics/java
parent650ce9aea4ddfaf07d852f5d80759277f7ea8571 (diff)
parente12e51892aee86b3ca4e7e268afed63006215010 (diff)
Merge "Add gatherPendingTransactions in BBQ"
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/BLASTBufferQueue.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java
index a9e730d58e65..2678c79d1454 100644
--- a/graphics/java/android/graphics/BLASTBufferQueue.java
+++ b/graphics/java/android/graphics/BLASTBufferQueue.java
@@ -39,6 +39,8 @@ public final class BLASTBufferQueue {
private static native long nativeGetLastAcquiredFrameNum(long ptr);
private static native void nativeApplyPendingTransactions(long ptr, long frameNumber);
private static native boolean nativeIsSameSurfaceControl(long ptr, long surfaceControlPtr);
+ private static native SurfaceControl.Transaction nativeGatherPendingTransactions(long ptr,
+ long frameNumber);
/** Create a new connection with the surface flinger. */
public BLASTBufferQueue(String name, SurfaceControl sc, int width, int height,
@@ -159,4 +161,17 @@ public final class BLASTBufferQueue {
public boolean isSameSurfaceControl(SurfaceControl sc) {
return nativeIsSameSurfaceControl(mNativeObject, sc.mNativeObject);
}
+
+ /**
+ * Get any transactions that were passed to {@link #mergeWithNextTransaction} with the
+ * specified frameNumber. This is intended to ensure transactions don't get stuck as pending
+ * if the specified frameNumber is never drawn.
+ *
+ * @param frameNumber The frameNumber used to determine which transactions to apply.
+ * @return a Transaction that contains the merge of all the transactions that were sent to
+ * mergeWithNextTransaction
+ */
+ public SurfaceControl.Transaction gatherPendingTransactions(long frameNumber) {
+ return nativeGatherPendingTransactions(mNativeObject, frameNumber);
+ }
}