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
This commit is contained in:
Robert Carr
2020-04-22 15:56:32 -07:00
parent adf530fc26
commit b9cf275b9b
6 changed files with 45 additions and 22 deletions

View File

@@ -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 {
}
}
}