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

Commit f315a466 authored by Vishnu Nair's avatar Vishnu Nair Committed by Automerger Merge Worker
Browse files

Merge "SurfaceView: Synchronize destframe updates with SurfaceView size...

Merge "SurfaceView: Synchronize destframe updates with SurfaceView size changes" into sc-dev am: 40ddf958

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15363651

Change-Id: Iaa4cd234f7c1d9ba8053bcccf18f1f04fc66e9d1
parents cdc7ff8e 40ddf958
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1242,7 +1242,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            mBlastSurfaceControl.setTransformHint(mTransformHint);
            mBlastSurfaceControl.setTransformHint(mTransformHint);
            if (mBlastBufferQueue != null) {
            if (mBlastBufferQueue != null) {
                mBlastBufferQueue.update(mBlastSurfaceControl, mSurfaceWidth, mSurfaceHeight,
                mBlastBufferQueue.update(mBlastSurfaceControl, mSurfaceWidth, mSurfaceHeight,
                        mFormat);
                        mFormat, transaction);
            }
            }
        } else {
        } else {
            transaction.setBufferSize(mSurfaceControl, mSurfaceWidth, mSurfaceHeight);
            transaction.setBufferSize(mSurfaceControl, mSurfaceWidth, mSurfaceHeight);
+5 −3
Original line number Original line Diff line number Diff line
@@ -105,9 +105,11 @@ static void nativeSetNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jlong
}
}


static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl, jlong width,
static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl, jlong width,
                         jlong height, jint format) {
                         jlong height, jint format, jlong transactionPtr) {
    sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
    sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
    queue->update(reinterpret_cast<SurfaceControl*>(surfaceControl), width, height, format);
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionPtr);
    queue->update(reinterpret_cast<SurfaceControl*>(surfaceControl), width, height, format,
                  transaction);
}
}


static void nativeFlushShadowQueue(JNIEnv* env, jclass clazz, jlong ptr) {
static void nativeFlushShadowQueue(JNIEnv* env, jclass clazz, jlong ptr) {
@@ -144,7 +146,7 @@ static const JNINativeMethod gMethods[] = {
        {"nativeGetSurface", "(JZ)Landroid/view/Surface;", (void*)nativeGetSurface},
        {"nativeGetSurface", "(JZ)Landroid/view/Surface;", (void*)nativeGetSurface},
        {"nativeDestroy", "(J)V", (void*)nativeDestroy},
        {"nativeDestroy", "(J)V", (void*)nativeDestroy},
        {"nativeSetNextTransaction", "(JJ)V", (void*)nativeSetNextTransaction},
        {"nativeSetNextTransaction", "(JJ)V", (void*)nativeSetNextTransaction},
        {"nativeUpdate", "(JJJJI)V", (void*)nativeUpdate},
        {"nativeUpdate", "(JJJJIJ)V", (void*)nativeUpdate},
        {"nativeFlushShadowQueue", "(J)V", (void*)nativeFlushShadowQueue},
        {"nativeFlushShadowQueue", "(J)V", (void*)nativeFlushShadowQueue},
        {"nativeMergeWithNextTransaction", "(JJJ)V", (void*)nativeMergeWithNextTransaction},
        {"nativeMergeWithNextTransaction", "(JJJ)V", (void*)nativeMergeWithNextTransaction},
        {"nativeSetTransactionCompleteCallback",
        {"nativeSetTransactionCompleteCallback",
+8 −2
Original line number Original line Diff line number Diff line
@@ -33,7 +33,7 @@ public final class BLASTBufferQueue {
    private static native Surface nativeGetSurface(long ptr, boolean includeSurfaceControlHandle);
    private static native Surface nativeGetSurface(long ptr, boolean includeSurfaceControlHandle);
    private static native void nativeSetNextTransaction(long ptr, long transactionPtr);
    private static native void nativeSetNextTransaction(long ptr, long transactionPtr);
    private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height,
    private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height,
            int format);
            int format, long transactionPtr);
    private static native void nativeFlushShadowQueue(long ptr);
    private static native void nativeFlushShadowQueue(long ptr);
    private static native void nativeMergeWithNextTransaction(long ptr, long transactionPtr,
    private static native void nativeMergeWithNextTransaction(long ptr, long transactionPtr,
                                                              long frameNumber);
                                                              long frameNumber);
@@ -92,9 +92,15 @@ public final class BLASTBufferQueue {
     * @param width The new width for the buffer.
     * @param width The new width for the buffer.
     * @param height The new height for the buffer.
     * @param height The new height for the buffer.
     * @param format The new format 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) {
    public void update(SurfaceControl sc, int width, int height, @PixelFormat.Format int format) {
        nativeUpdate(mNativeObject, sc.mNativeObject, width, height, format);
        nativeUpdate(mNativeObject, sc.mNativeObject, width, height, format, 0);
    }
    }


    /**
    /**