From b9cf275b9bf4a5cd2f941c422ee728a4bf155601 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 22 Apr 2020 15:56:32 -0700 Subject: BLAST: Two start-up optimizations 1. Avoid a seperate IPC querying in to system-server to initialize the mUseBLAST flag. 2. Avoid calling property_get_bool with each BufferQueue creation. Instead we piggy-back both values inside addWindow return values. Bug: 152501005 Test: Existing tests pass Change-Id: If130560a8230f8d399cf7631264d551522939faa --- graphics/java/android/graphics/BLASTBufferQueue.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'graphics') diff --git a/graphics/java/android/graphics/BLASTBufferQueue.java b/graphics/java/android/graphics/BLASTBufferQueue.java index 8c6a9371d53b..4c7e960eb0a4 100644 --- a/graphics/java/android/graphics/BLASTBufferQueue.java +++ b/graphics/java/android/graphics/BLASTBufferQueue.java @@ -26,15 +26,17 @@ public final class BLASTBufferQueue { // Note: This field is accessed by native code. private long mNativeObject; // BLASTBufferQueue* - private static native long nativeCreate(long surfaceControl, long width, long height); + private static native long nativeCreate(long surfaceControl, long width, long height, + boolean tripleBufferingEnabled); private static native void nativeDestroy(long ptr); private static native Surface nativeGetSurface(long ptr); private static native void nativeSetNextTransaction(long ptr, long transactionPtr); private static native void nativeUpdate(long ptr, long surfaceControl, long width, long height); /** Create a new connection with the surface flinger. */ - public BLASTBufferQueue(SurfaceControl sc, int width, int height) { - mNativeObject = nativeCreate(sc.mNativeObject, width, height); + public BLASTBufferQueue(SurfaceControl sc, int width, int height, + boolean tripleBufferingEnabled) { + mNativeObject = nativeCreate(sc.mNativeObject, width, height, tripleBufferingEnabled); } public void destroy() { @@ -64,4 +66,3 @@ public final class BLASTBufferQueue { } } } - -- cgit v1.2.3