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

Commit 54a79e21 authored by Melody Hsu's avatar Melody Hsu Committed by Android (Google) Code Review
Browse files

Merge "Support SurfaceControlRegistry logs in native" into main

parents 577d21e1 99fa3031
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -312,6 +312,7 @@ public final class SurfaceControl implements Parcelable {
    private static native void nativeNotifyShutdown();
    private static native void nativeSetLuts(long transactionObj, long nativeObject,
            float[] buffers, int[] slots, int[] dimensions, int[] sizes, int[] samplingKeys);
    private static native void nativeEnableDebugLogCallPoints(long transactionObj);

    /**
     * Transforms that can be applied to buffers as they are displayed to a window.
@@ -4605,7 +4606,6 @@ public final class SurfaceControl implements Parcelable {
        }

        /**
         * TODO(b/366484871): To be removed once we have some logging in native
         * This is called when BlastBufferQueue.mergeWithNextTransaction() is called from java, and
         * for the purposes of logging that path.
         */
@@ -4616,6 +4616,7 @@ public final class SurfaceControl implements Parcelable {
                if (mCalls != null) {
                    mCalls.clear();
                }
                nativeEnableDebugLogCallPoints(mNativeObject);
            }
        }

+6 −0
Original line number Diff line number Diff line
@@ -2403,6 +2403,11 @@ SurfaceComposerClient::Transaction* android_view_SurfaceTransaction_getNativeSur
    }
}

static void nativeEnableDebugLogCallPoints(JNIEnv* env, jclass clazz, jlong transactionObj) {
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
    transaction->enableDebugLogCallPoints();
}

static const JNINativeMethod sSurfaceControlMethods[] = {
        // clang-format off
    {"nativeCreate", "(Landroid/view/SurfaceSession;Ljava/lang/String;IIIIJLandroid/os/Parcel;)J",
@@ -2649,6 +2654,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
    {"nativeNotifyShutdown", "()V",
            (void*)nativeNotifyShutdown },
    {"nativeSetLuts", "(JJ[F[I[I[I[I)V", (void*)nativeSetLuts },
    {"nativeEnableDebugLogCallPoints", "(J)V", (void*)nativeEnableDebugLogCallPoints },
        // clang-format on
};