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

Commit 1e95fc86 authored by Miao Wang's avatar Miao Wang
Browse files

[RenderScript] Update RenderScript JNI with the corresponding

AllocationGetSurface driver implementation change.

 - AllocationGetSurface now returns opaque handle to ANativeWindow*,
 instead of IGraphicBufferProducer*, as IGraphicBufferProducer is not
 part of NDK. So the JNI side need to change accordingly.

Bug: 34396220
Test: mm, CTS tests pass.
Change-Id: If9b6a733202d29bc40c0e0b87c4fb48db092cbe5
parent 33287e8a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1266,10 +1266,10 @@ nAllocationGetSurface(JNIEnv *_env, jobject _this, jlong con, jlong a)
        ALOGD("nAllocationGetSurface, con(%p), a(%p)", (RsContext)con, (RsAllocation)a);
    }

    IGraphicBufferProducer *v = (IGraphicBufferProducer *)rsAllocationGetSurface((RsContext)con,
                                                                                 (RsAllocation)a);
    sp<IGraphicBufferProducer> bp = v;
    v->decStrong(nullptr);
    ANativeWindow *anw = (ANativeWindow *)rsAllocationGetSurface((RsContext)con, (RsAllocation)a);

    sp<Surface> surface(static_cast<Surface*>(anw));
    sp<IGraphicBufferProducer> bp = surface->getIGraphicBufferProducer();

    jobject o = android_view_Surface_createFromIGraphicBufferProducer(_env, bp);
    return o;