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

Commit 869c1693 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Rename nextTransaction to syncTransaction"

parents c2f0bf85 989aa9b7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(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},
+3 −3
Original line number Diff line number Diff line
@@ -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);
    }

    /**