summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2022-02-24 23:18:22 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-02-24 23:18:22 +0000
commit7da5f02dc987a30939a6e35cc12fa0e4a42bd93f (patch)
tree30d773a6607927dfcf2a310b60f15988e7a63040 /graphics/java
parentc67e95c7f8e5835b716f12ba8fb92cf0f560513b (diff)
parent6011059ed07abafa7fe0180848302191c72160de (diff)
Merge changes from topics "cherrypick-sv-changes-8cq54jfvx9", "sv-changes-tm-dev" into tm-dev
* changes: SurfaceView: Synchronize all surface view changes with VRI draw SurfaceView: Avoid destination frame updates on multiple threads 1/2
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/BLASTBufferQueue.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java
index 2678c79d1454..369f20fb52a7 100644
--- a/graphics/java/android/graphics/BLASTBufferQueue.java
+++ b/graphics/java/android/graphics/BLASTBufferQueue.java
@@ -27,13 +27,13 @@ public final class BLASTBufferQueue {
// Note: This field is accessed by native code.
public long mNativeObject; // BLASTBufferQueue*
- private static native long nativeCreate(String name);
+ private static native long nativeCreate(String name, boolean updateDestinationFrame);
private static native void nativeDestroy(long ptr);
private static native Surface nativeGetSurface(long ptr, boolean includeSurfaceControlHandle);
private static native void nativeSetSyncTransaction(long ptr, long transactionPtr,
boolean acquireSingleBuffer);
private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height,
- int format, long transactionPtr);
+ int format);
private static native void nativeMergeWithNextTransaction(long ptr, long transactionPtr,
long frameNumber);
private static native long nativeGetLastAcquiredFrameNum(long ptr);
@@ -45,12 +45,12 @@ public final class BLASTBufferQueue {
/** Create a new connection with the surface flinger. */
public BLASTBufferQueue(String name, SurfaceControl sc, int width, int height,
@PixelFormat.Format int format) {
- this(name);
+ this(name, false /* updateDestinationFrame */);
update(sc, width, height, format);
}
- public BLASTBufferQueue(String name) {
- mNativeObject = nativeCreate(name);
+ public BLASTBufferQueue(String name, boolean updateDestinationFrame) {
+ mNativeObject = nativeCreate(name, updateDestinationFrame);
}
public void destroy() {
@@ -101,15 +101,9 @@ public final class BLASTBufferQueue {
* @param width The new width for the buffer.
* @param height The new height for the buffer.
* @param format The new format for the buffer.
- * @param t Adds destination frame changes to the passed in transaction.
*/
- public void update(SurfaceControl sc, int width, int height, @PixelFormat.Format int format,
- SurfaceControl.Transaction t) {
- nativeUpdate(mNativeObject, sc.mNativeObject, width, height, format, t.mNativeObject);
- }
-
public void update(SurfaceControl sc, int width, int height, @PixelFormat.Format int format) {
- nativeUpdate(mNativeObject, sc.mNativeObject, width, height, format, 0);
+ nativeUpdate(mNativeObject, sc.mNativeObject, width, height, format);
}
@Override