From a9997a38fedbd5328f651eb2df95a0607f5c38e2 Mon Sep 17 00:00:00 2001 From: chaviw Date: Tue, 7 Sep 2021 17:51:45 -0500 Subject: [PATCH] Remove flushShadowQueue flushShadowQueue no longer does anything in BBQ so remove from Java and JNI code. Test: Builds Fixes: 199204968 Change-Id: I4df67a23732ba4ffaca42390b29d3f81cadd6457 --- core/java/android/view/ViewRootImpl.java | 9 +-------- core/jni/android_graphics_BLASTBufferQueue.cpp | 6 ------ graphics/java/android/graphics/BLASTBufferQueue.java | 5 ----- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 9e2b6e0a26868..042219f4cb0bb 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -4086,18 +4086,16 @@ public final class ViewRootImpl implements ViewParent, private void addFrameCallbackIfNeeded() { final boolean nextDrawUseBlastSync = mNextDrawUseBlastSync; - final boolean reportNextDraw = mReportNextDraw; final boolean hasBlurUpdates = mBlurRegionAggregator.hasUpdates(); final boolean needsCallbackForBlur = hasBlurUpdates || mBlurRegionAggregator.hasRegions(); - if (!nextDrawUseBlastSync && !reportNextDraw && !needsCallbackForBlur) { + if (!nextDrawUseBlastSync && !needsCallbackForBlur) { return; } if (DEBUG_BLAST) { Log.d(mTag, "Creating frameDrawingCallback" + " nextDrawUseBlastSync=" + nextDrawUseBlastSync - + " reportNextDraw=" + reportNextDraw + " hasBlurUpdates=" + hasBlurUpdates); } mWaitForBlastSyncComplete = nextDrawUseBlastSync; @@ -4137,11 +4135,6 @@ public final class ViewRootImpl implements ViewParent, } mHandler.postAtFrontOfQueue(this::clearBlastSync); }); - } else if (reportNextDraw) { - // If we need to report next draw, wait for adapter to flush its shadow queue - // by processing previously queued buffers so that we can submit the - // transaction a timely manner. - mBlastBufferQueue.flushShadowQueue(); } }; registerRtFrameCallback(frameDrawingCallback); diff --git a/core/jni/android_graphics_BLASTBufferQueue.cpp b/core/jni/android_graphics_BLASTBufferQueue.cpp index 3e31b46b5bda5..3b7328e72913a 100644 --- a/core/jni/android_graphics_BLASTBufferQueue.cpp +++ b/core/jni/android_graphics_BLASTBufferQueue.cpp @@ -112,11 +112,6 @@ static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceCont transaction); } -static void nativeFlushShadowQueue(JNIEnv* env, jclass clazz, jlong ptr) { - sp queue = reinterpret_cast(ptr); - queue->flushShadowQueue(); -} - static void nativeMergeWithNextTransaction(JNIEnv*, jclass clazz, jlong ptr, jlong transactionPtr, jlong framenumber) { sp queue = reinterpret_cast(ptr); @@ -152,7 +147,6 @@ static const JNINativeMethod gMethods[] = { {"nativeDestroy", "(J)V", (void*)nativeDestroy}, {"nativeSetNextTransaction", "(JJ)V", (void*)nativeSetNextTransaction}, {"nativeUpdate", "(JJJJIJ)V", (void*)nativeUpdate}, - {"nativeFlushShadowQueue", "(J)V", (void*)nativeFlushShadowQueue}, {"nativeMergeWithNextTransaction", "(JJJ)V", (void*)nativeMergeWithNextTransaction}, {"nativeSetTransactionCompleteCallback", "(JJLandroid/graphics/BLASTBufferQueue$TransactionCompleteCallback;)V", diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java index 0e1360fcdbbca..2393eaf32e9a1 100644 --- a/graphics/java/android/graphics/BLASTBufferQueue.java +++ b/graphics/java/android/graphics/BLASTBufferQueue.java @@ -34,7 +34,6 @@ public final class BLASTBufferQueue { private static native void nativeSetNextTransaction(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 nativeFlushShadowQueue(long ptr); private static native void nativeMergeWithNextTransaction(long ptr, long transactionPtr, long frameNumber); private static native void nativeSetTransactionCompleteCallback(long ptr, long frameNumber, @@ -125,10 +124,6 @@ public final class BLASTBufferQueue { } } - public void flushShadowQueue() { - nativeFlushShadowQueue(mNativeObject); - } - /** * Merge the transaction passed in to the next transaction in BlastBufferQueue. The next * transaction will be applied or merged when the next frame with specified frame number