summaryrefslogtreecommitdiff
path: root/rs/jni/android_renderscript_RenderScript.cpp
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2017-03-09 20:51:50 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-09 20:51:50 +0000
commitdb889edb1ddc8d032dbbacdb69494eb8573e6ca5 (patch)
tree37e4766427a26d680ee7a40b63f6e205fe7bb360 /rs/jni/android_renderscript_RenderScript.cpp
parent483a424903807f5b9ae836caf35c17600c4e3ce8 (diff)
parent70fac233fad400031ff4b9986fcd3273d21f71fe (diff)
Merge changes from topic 'USAGE_IO_INPUT'
am: 70fac233fa Change-Id: I3f8db9b25a8ccee8ddb596baf5e54a268747de9f
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;