diff options
author | Jason Sams <rjsams@android.com> | 2011-04-27 16:33:11 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2011-04-27 16:33:11 -0700 |
commit | 6e494d3ab606be8c06f8d4930fbec572bbfa15c2 (patch) | |
tree | ffd17bfd895705529e4542280e78dd1d6aa8a15a /graphics/jni/android_renderscript_RenderScript.cpp | |
parent | a08526ac42b3da98926ae921a6d8cfb9bbc90553 (diff) | |
download | frameworks_base-6e494d3ab606be8c06f8d4930fbec572bbfa15c2.zip frameworks_base-6e494d3ab606be8c06f8d4930fbec572bbfa15c2.tar.gz frameworks_base-6e494d3ab606be8c06f8d4930fbec572bbfa15c2.tar.bz2 |
Add dalvik code for forEach.
Change-Id: I26533fc553315b99b8f177ab62d9735a177b26b0
Diffstat (limited to 'graphics/jni/android_renderscript_RenderScript.cpp')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index c3f2360..3f6f8c3 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -866,6 +866,24 @@ nScriptInvokeV(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slo _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT); } +static void +nScriptForEach(JNIEnv *_env, jobject _this, RsContext con, + jint script, jint slot, jint ain, jint aout) +{ + LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot); + rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0); +} +static void +nScriptForEachV(JNIEnv *_env, jobject _this, RsContext con, + jint script, jint slot, jint ain, jint aout, jbyteArray params) +{ + LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot); + jint len = _env->GetArrayLength(params); + jbyte *ptr = _env->GetByteArrayElements(params, NULL); + rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len); + _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT); +} + // ----------------------------------- @@ -1235,6 +1253,8 @@ static JNINativeMethod methods[] = { {"rsnScriptSetTimeZone", "(II[B)V", (void*)nScriptSetTimeZone }, {"rsnScriptInvoke", "(III)V", (void*)nScriptInvoke }, {"rsnScriptInvokeV", "(III[B)V", (void*)nScriptInvokeV }, +{"rsnScriptForEach", "(IIIII)V", (void*)nScriptForEach }, +{"rsnScriptForEach", "(IIIII[B)V", (void*)nScriptForEachV }, {"rsnScriptSetVarI", "(IIII)V", (void*)nScriptSetVarI }, {"rsnScriptSetVarJ", "(IIIJ)V", (void*)nScriptSetVarJ }, {"rsnScriptSetVarF", "(IIIF)V", (void*)nScriptSetVarF }, |