diff options
author | Jason Sams <jsams@google.com> | 2013-02-05 19:20:18 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-02-05 19:20:18 -0800 |
commit | 455d64426615e5d269a3bd05cd91b67c3811fcdf (patch) | |
tree | 25014401d9053c07d9d4091ef65e6a15dde5913f /graphics/jni | |
parent | a4b7bc97862e01d38b483524f1d1cf433d29e294 (diff) | |
download | frameworks_base-455d64426615e5d269a3bd05cd91b67c3811fcdf.zip frameworks_base-455d64426615e5d269a3bd05cd91b67c3811fcdf.tar.gz frameworks_base-455d64426615e5d269a3bd05cd91b67c3811fcdf.tar.bz2 |
Implement rs.sendMessage()
Change-Id: Ib4f4bb7bb4f697d0b5405ad55721394ed2456c65
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 54413b4..80001a6 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -346,6 +346,23 @@ static void nContextDeinitToClient(JNIEnv *_env, jobject _this, RsContext con) rsContextDeinitToClient(con); } +static void +nContextSendMessage(JNIEnv *_env, jobject _this, RsContext con, jint id, jintArray data) +{ + jint *ptr = NULL; + jint len = 0; + if (data) { + len = _env->GetArrayLength(data); + jint *ptr = _env->GetIntArrayElements(data, NULL); + } + LOG_API("nContextSendMessage, con(%p), id(%i), len(%i)", con, id, len); + rsContextSendMessage(con, id, (const uint8_t *)ptr, len * sizeof(int)); + if (data) { + _env->ReleaseIntArrayElements(data, ptr, JNI_ABORT); + } +} + + static jint nElementCreate(JNIEnv *_env, jobject _this, RsContext con, jint type, jint kind, jboolean norm, jint size) @@ -1434,6 +1451,7 @@ static JNINativeMethod methods[] = { {"rsnContextDump", "(II)V", (void*)nContextDump }, {"rsnContextPause", "(I)V", (void*)nContextPause }, {"rsnContextResume", "(I)V", (void*)nContextResume }, +{"rsnContextSendMessage", "(II[I)V", (void*)nContextSendMessage }, {"rsnAssignName", "(II[B)V", (void*)nAssignName }, {"rsnGetName", "(II)Ljava/lang/String;", (void*)nGetName }, {"rsnObjDestroy", "(II)V", (void*)nObjDestroy }, |