BLASTBufferQueue JNI: Call getSurface

BLASTBufferQueue now uses a Surface subclass, and so we need
to call getSurface instead of using the BufferProducer and
constructing a Surface in JNI.

Bug: 168504871
Test: Existing tests pass
Change-Id: Ic11fb96050264310ae967eeadb0ed5de1027c866
This commit is contained in:
Robert Carr
2020-10-13 18:23:12 -07:00
parent f82f0bc28e
commit 23779a7b47
2 changed files with 2 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ static void nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) {
static jobject nativeGetSurface(JNIEnv* env, jclass clazz, jlong ptr) {
sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr);
return android_view_Surface_createFromIGraphicBufferProducer(env, queue->getIGraphicBufferProducer());
return android_view_Surface_createFromSurface(env, queue->getSurface());
}
static void nativeSetNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jlong transactionPtr) {

View File

@@ -313,7 +313,7 @@ static jlong nativeGetFromBlastBufferQueue(JNIEnv* env, jclass clazz, jlong nati
return nativeObject;
}
sp<Surface> surface(new Surface(bufferProducer, true));
sp<Surface> surface = queue->getSurface();
if (surface != NULL) {
surface->incStrong(&sRefBaseOwner);
}