summaryrefslogtreecommitdiff
path: root/rs/jni/android_renderscript_RenderScript.cpp
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2017-03-04 16:28:56 -0800
committerMiao Wang <miaowang@google.com>2017-03-06 10:03:30 -0800
commit1e95fc86581514c718fc96367f6d575e87fecffb (patch)
treec632aec9a7a04aa3e6308bb92b5610b24165070f /rs/jni/android_renderscript_RenderScript.cpp
parent33287e8a893821be86b395ce9d5d639cc8a535f3 (diff)
[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
Diffstat (limited to 'rs/jni/android_renderscript_RenderScript.cpp')
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index c663255d3315..b4630efe80e8 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -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;