diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index c88d4f867dc3e..ce96ecaf9c2f8 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -211,13 +211,13 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.lang.ref.WeakReference; import java.util.ArrayList; -import java.util.function.Consumer; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Objects; import java.util.Queue; import java.util.concurrent.CountDownLatch; +import java.util.function.Consumer; /** * The top of a view hierarchy, implementing the needed protocol between View @@ -730,7 +730,7 @@ public final class ViewRootImpl implements ViewParent, /** * This is only used on the RenderThread when handling a blast sync. Specifically, it's only - * used when calling {@link BLASTBufferQueue#setNextTransaction(Transaction)} and then merged + * used when calling {@link BLASTBufferQueue#setSyncTransaction(Transaction)} and then merged * with a tmp transaction on the Render Thread. The tmp transaction is then merged into * {@link #mSurfaceChangedTransaction} on the UI Thread, avoiding any threading issues. */ @@ -3999,7 +3999,7 @@ public final class ViewRootImpl implements ViewParent, // draw attempt. The next transaction and transaction complete callback were only set // for the current draw attempt. if (frameWasNotDrawn) { - mBlastBufferQueue.setNextTransaction(null); + mBlastBufferQueue.setSyncTransaction(null); // Apply the transactions that were sent to mergeWithNextTransaction since the // frame didn't draw on this vsync. It's possible the frame will draw later, but // it's better to not be sync than to block on a frame that may never come. @@ -4095,7 +4095,7 @@ public final class ViewRootImpl implements ViewParent, // We don't need to synchronize mRtBLASTSyncTransaction here since it's not // being modified and only sent to BlastBufferQueue. - mBlastBufferQueue.setNextTransaction(mRtBLASTSyncTransaction); + mBlastBufferQueue.setSyncTransaction(mRtBLASTSyncTransaction); } }; registerRtFrameCallback(frameDrawingCallback); diff --git a/core/jni/android_graphics_BLASTBufferQueue.cpp b/core/jni/android_graphics_BLASTBufferQueue.cpp index a7362ab3c3fa3..cdfd089719052 100644 --- a/core/jni/android_graphics_BLASTBufferQueue.cpp +++ b/core/jni/android_graphics_BLASTBufferQueue.cpp @@ -61,10 +61,10 @@ static jobject nativeGetSurface(JNIEnv* env, jclass clazz, jlong ptr, queue->getSurface(includeSurfaceControlHandle)); } -static void nativeSetNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jlong transactionPtr) { +static void nativeSetSyncTransaction(JNIEnv* env, jclass clazz, jlong ptr, jlong transactionPtr) { sp queue = reinterpret_cast(ptr); auto transaction = reinterpret_cast(transactionPtr); - queue->setNextTransaction(transaction); + queue->setSyncTransaction(transaction); } static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl, jlong width, @@ -98,7 +98,7 @@ static const JNINativeMethod gMethods[] = { {"nativeCreate", "(Ljava/lang/String;JJJI)J", (void*)nativeCreate}, {"nativeGetSurface", "(JZ)Landroid/view/Surface;", (void*)nativeGetSurface}, {"nativeDestroy", "(J)V", (void*)nativeDestroy}, - {"nativeSetNextTransaction", "(JJ)V", (void*)nativeSetNextTransaction}, + {"nativeSetSyncTransaction", "(JJ)V", (void*)nativeSetSyncTransaction}, {"nativeUpdate", "(JJJJIJ)V", (void*)nativeUpdate}, {"nativeMergeWithNextTransaction", "(JJJ)V", (void*)nativeMergeWithNextTransaction}, {"nativeGetLastAcquiredFrameNum", "(J)J", (void*)nativeGetLastAcquiredFrameNum}, diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java index 9af508a2d2c4c..405f66dd5d561 100644 --- a/graphics/java/android/graphics/BLASTBufferQueue.java +++ b/graphics/java/android/graphics/BLASTBufferQueue.java @@ -31,7 +31,7 @@ public final class BLASTBufferQueue { long height, int format); private static native void nativeDestroy(long ptr); private static native Surface nativeGetSurface(long ptr, boolean includeSurfaceControlHandle); - private static native void nativeSetNextTransaction(long ptr, long transactionPtr); + private static native void nativeSetSyncTransaction(long ptr, long transactionPtr); private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height, int format, long transactionPtr); private static native void nativeMergeWithNextTransaction(long ptr, long transactionPtr, @@ -70,8 +70,8 @@ public final class BLASTBufferQueue { * This gives the caller a chance to apply the transaction when it's ready. * @param t The transaction to add the frame to. This can be null to clear the transaction. */ - public void setNextTransaction(@Nullable SurfaceControl.Transaction t) { - nativeSetNextTransaction(mNativeObject, t == null ? 0 : t.mNativeObject); + public void setSyncTransaction(@Nullable SurfaceControl.Transaction t) { + nativeSetSyncTransaction(mNativeObject, t == null ? 0 : t.mNativeObject); } /**